WongKinYiu / yolov7

Implementation of paper - YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors
GNU General Public License v3.0
13.02k stars 4.12k forks source link

how to test custom model ? map of each class #357

Open akashAD98 opened 1 year ago

akashAD98 commented 1 year ago

as we do testing in alexyab darknet-how can we do same testing here?

i tried this command but getting errors.

m customdata folder has all testing images with there bounding box

!python test.py --data /content/gdrive/MyDrive/yolov7/data/custom_yolov7_data-personal46.yaml --img 640 --batch 16 --conf 0.50 --iou 0.65 --device 0 --weights /content/gdrive/MyDrive/yolov7/weights/personalitems46_ad/best.pt --name yolov7_640_persomnalitem_test --save-txt


# train and val data as 1) directory: path/images/, 2) file: path/images.txt, or 3) list: [path1/images/, path2/images/]
#train: ./customdata/train.txt  
#val: ./customdata/valid.txt  
test:./customdata/valid.txt  

# number of classes

nc: 46
# class names

names: ['toothbrush','tooth paste','applied lipstick','teddy bear','soft toy',
'money(single note)','coins',
'key','identity card','board game','Stick','playing cards','lipstick','money(bundle notes)','treadmill',
'toy robot','rubiks cube','drone','umbrella','tiffin box','helmet','binoculars','iron',
'telescope','lighter','hammer','wheelchair','ludo','diamond','diving equipment','comb','doll','toy car',
'screw driver','shaving razor','stethoscope','weights','stretcher','tent','parachute',
'skipping rope','mike','gold bar','hand fan','toy','collection of gold bar']```
akashAD98 commented 1 year ago

using this command will get result !python test.py --data /content/gdrive/MyDrive/yolov7/data/custom_yolov7_data-personal46.yaml --img 640 --batch 24 --conf 0.50 --iou 0.65 --device 0 --weights /content/gdrive/MyDrive/yolov7/weights/best_personalitems46.pt --save-txt --save-hybrid --save-json --save-conf --augment --task val

akashAD98 commented 1 year ago

@AlexeyAB @WongKinYiu im not able to get map of each class. I'm getting only 1 overall map result.

!python test.py --data /content/gdrive/MyDrive/yolov7/data/custom_yolov7.yaml --img 640 --batch 24 --conf 0.50 --iou 0.65 --device 0 --weights /content/gdrive/MyDrive/yolov7/weights/best.pt --save-txt --save-hybrid --save-json --save-conf --augment --task val
image

which command I need to use to get map of each class?

WongKinYiu commented 1 year ago

--vebose