Skip to content
Snippets Groups Projects
Commit 797ce2c0 authored by Stephane Chavin's avatar Stephane Chavin
Browse files

correction readme

parent 0d382923
No related branches found
No related tags found
No related merge requests found
......@@ -166,8 +166,43 @@ python3 train.py --img IMG_SIZE --batch BATCH_SIZE --epochs NB_EPOCHS --data DIR
* Lancer un entrainement sur de l'audio
--weights: Model path or triton URL. Default is 'yolov5s.pt'.
--source: File/dir/URL/glob/screen/0(webcam) for input source. Default is 'data/images'.
--data: Optional dataset.yaml path. Default is 'data/coco128.yaml'.
--imgsz: Inference size height and width. Default is [640].
--conf-thres: Confidence threshold. Default is 0.25.
--iou-thres: NMS IoU threshold. Default is 0.45.
--max-det: Maximum detections per image. Default is 1000.
--device: Cuda device, e.g., 0 or 0,1,2,3 or cpu. Default is ''.
--view-img: Show results. Action 'store_true'.
--save-txt: Save results to *.txt. Action 'store_true'.
--save-conf: Save confidences in --save-txt labels. Action 'store_true'.
--save-crop: Save cropped prediction boxes. Action 'store_true'.
--nosave: Do not save images/videos. Action 'store_true'.
--classes: Filter by class. Example: --classes 0, or --classes 0 2 3.
--agnostic-nms: Class-agnostic NMS. Action 'store_true'.
--augment: Augmented inference. Action 'store_true'.
--visualize: Visualize features. Action 'store_true'.
--update: Update all models. Action 'store_true'.
--project: Save results to project/name. Default is 'runs/detect'.
--name: Save results to project/name. Default is 'exp'.
--exist-ok: Existing project/name ok, do not increment. Action 'store_true'.
--line-thickness: Bounding box thickness (pixels). Default is 3.
--hide-labels: Hide labels. Default is False. Action 'store_true'.
--sampleDur: Duration for each spectrogram for detection. Default is 8.
--sr: Samplerate for each spectrogram for detection. Default is 22050.
--window: Window size for each spectrogram for detection. Default is 1024.
--hop: Hop length for each spectrogram for detection. Default is 512.
--hide-conf: Hide confidences. Default is False. Action 'store_true'.
--half: Use FP16 half-precision inference. Action 'store_true'.
--sound: Enable sound. Default is False. Action 'store_true'.
--dnn: Use OpenCV DNN for ONNX inference. Action 'store_true'.
--vid-stride: Video frame-rate stride. Default is 1.
Exemple :
```bash
python3 detect.py --weights yolov5/runs/train/EXP_NB/weights/best.pt --img IMG_SIZE --conf 0.X --source PATH_TO_FOLDER_THAT_CONTAIN_WAV --save-txt --sound --sr X --sampleDur Y --window --hop
python3 detect.py --weights yolov5/runs/train/EXP_NB/weights/best.pt --img IMG_SIZE --conf 0.X --source PATH_TO_FOLDER_THAT_CONTAIN_WAV --save-txt --sound --sr X --sampleDur Y --window Z --hop W
```
* Sauvegarde les annotations en .txt ainsi que les images avec les bounding box dessus
......@@ -178,7 +213,7 @@ python3 detect.py --weights yolov5/runs/train/EXP_NB/weights/best.pt --img IMG_S
**WARNING** : Il faut adapter EXP_NB, qui correspond au numéro de l'entrainement *(exp1 pour le premier entrainement)*
--conf correspond à la confiance toléré par YOLO, c'est-à-dire à partir de quelle confiance d'une détection cette dernière est conservée, il faut donc modifier la valeur de X pour faire varier cette tolérence *(minimum : 0.0, maximum : 1)*
* Sauvegarde les annotations en .txt seulement avec la confiance de chaque détections
* Sauvegarde les annotations en .txt seulement avec la confiance de chaque détections (add --nosave)
```bash
python3 detect.py --weights yolov5/runs/train/EXP_NB/weights/best.pt --img IMG_SIZE --conf 0.X --source PATH_TO_SPECTROGRAM_TO_DETECT --save-txt --nosave --save-conf
......@@ -192,7 +227,7 @@ python3 detect.py --weights yolov5/runs/train/EXP_NB/weights/best.pt --img IMG_S
cd ../
python3 get_yolo_detection.py -p PATH_TO_THE_TXT -d DIRECTION_OF_THE_RESULT #PATH_TO_THE_TXT ~ yolov5/runs/detect/expX/labels
```
**WARNING** : Il est important d'ajouter sa propre liste de classes (ligne 30)
**WARNING** : Il est important d'ajouter sa propre liste de classes (ligne 31)
```python
#put the classes here
......@@ -203,14 +238,11 @@ names = []
```bash
cd ../
python3 get_time_freq_detection.py -p PATH_TO_THE_TXT -s SR -t DURATION -d DIRECTION_OF_THE_RESULT #PATH_TO_THE_TXT ~ yolov5/runs/detect/expX/labels
python3 get_time_freq_detection.py PATH_TO_THE_TXT DIRECTION_OF_THE_RESULT PATH_TO_THE_YAML_FILE -s SR --duration DURATION
```
**WARNING** : Il est important d'ajouter sa propre liste de classes (ligne 39)
```python
DUREE_SPECTRO = args.duration
SR = args.SR
#put the classes here
names = []
```
......
......@@ -52,6 +52,7 @@ if __name__ == "__main__":
parser.add_argument('path_to_data', type=arg_directory, help='Path of the folder that contains the .txt files')
parser.add_argument('directory', type=arg_directory, help='Directory where the dataframe will be stored')
parser.add_argument('names', type=str, help='path to YOLOv5 custom_data.yaml file')
parser.add_argument('-s','--sr', type=int, help='Sampling Rate of the spectrogram', required=True)
parser.add_argument('--duration', type=int, help='Duration of the spectrogram', default=8)
args = parser.parse_args()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment