Johnathan-Xie / ZSD-YOLO

GNU General Public License v3.0
50 stars 2 forks source link

Hello, how do I get the results of Recall? #8

Closed 0x0f0f0f0f closed 1 year ago

0x0f0f0f0f commented 1 year ago

Hi author, how do I get the results of recall and why do I get lower results using

_python3 test.py --weights weights/model_checkpoints/yolov5x_coco_65_15_zsd_self.pt --data data/coco/coco_zsd_2014_test_65_15.yaml --img 640 --save-json --zsd --annot-folder labels2014_zsd_self_test_l_6515 --obj-conf-thresh 0.1 --batch-size 20 --iou-thres 0.4 --conf-thres 0.001 --max-det 15 --verbose --exist-ok --plot-conf 0.1

than the data in the paper?The test results are as follows, (zsd-yolo) ubuntu@ylhh:/media/ubuntu/dataset/ZSD-YOLO$ python3 test.py --weights weights/model_checkpoints/yolov5x_coco_65_15_zsd_self.pt --data data/coco/coco_zsd_2014_test_65_15.yaml --img 640 --save-json --zsd --annot-folder labels2014_zsd_self_test_l_65_15 --obj-conf-thresh 0.1 --batch-size 20 --iou-thres 0.4 --conf-thres 0.001 --max-det 15 --verbose --exist-ok --plot-conf 0.1 Namespace(agnostic_nms=False, annot_folder='labels2014_zsd_self_test_l_65_15', augment=False, batch_size=20, conf_thres=0.001, data='data/coco/coco_zsd_2014_test_65_15.yaml', device='', eval_by_splits=False, eval_splits=[], exist_ok=True, favor=None, hyp=None, img_size=640, iou_thres=0.4, max_det=15, name='exp', nms_then_zsd=False, no_zsd_post=False, obj_conf_thresh=0.1, plot_conf=0.1, project='runs/test', save_conf=False, save_hybrid=False, save_json=True, save_txt=False, single_cls=False, task='val', text_embedding_path=None, verbose=True, visualization_demo=False, weights=['weights/model_checkpoints/yolov5x_coco_65_15_zsd_self.pt'], zsd=True) 20 YOLOv5 🚀 4057e6c torch 1.9.0+cu111 CUDA:0 (GeForce RTX 3090, 24267.0MB)

Fusing layers... /home/ubuntu/anaconda3/envs/zsd-yolo/lib/python3.8/site-packages/torch/nn/functional.py:718: UserWarning: Named tensors and all their associated APIs are an experimental feature and subject to change. Please do not use them for anything important until they are released as stable. (Triggered internally at /pytorch/c10/core/TensorImpl.h:1156.) return torch.max_pool2d(input, kernel_size, stride, padding, dilation, ceil_mode) Model Summary: 478 layers, 90637726 parameters, 0 gradients, 228.1 GFLOPS torch.Size([15, 512]) <class 'utils.datasets.LoadZSD'> Removing images without annotations. 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10098/10098 [00:41<00:00, 241.93it/s] Originally: 10098 train images. Found only 10098 label files. 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10098/10098 [00:01<00:00, 6223.93it/s] 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10098/10098 [00:12<00:00, 817.40it/s] Class Images Labels P R mAP@.5 mAP@.5:.95: 100%|██████████████████████████████████████████████████████████████████████████████████████████| 505/505 [02:16<00:00, 3.71it/s] val_names 10098 16339 0.131 0.425 0.183 0.107 hhhhhhhhhhhhhhhhhhhhhhhh

      4 airplane       10098        1444        0.32       0.344       0.183      0.0913
         6 train       10098        1602       0.216       0.697       0.321       0.173
12 parking meter       10098         510      0.0176       0.155      0.0203      0.0127
          15 cat       10098        1669       0.512       0.386       0.362       0.226
         21 bear       10098         462      0.0788       0.918        0.54       0.389
     28 suitcase       10098        2219      0.0546       0.382       0.101      0.0502
      29 frisbee       10098         935       0.063       0.561       0.294       0.192
    31 snowboard       10098         793       0.117        0.59       0.395       0.205
         42 fork       10098        1775      0.0532       0.428       0.151      0.0719
     48 sandwich       10098        1457       0.125       0.533       0.119      0.0623
      52 hot dog       10098        1009       0.138       0.282      0.0786      0.0418
       61 toilet       10098        1462       0.183       0.436       0.129      0.0644
        64 mouse       10098         850      0.0276       0.359       0.033      0.0228
      70 toaster       10098          78      0.0234       0.256      0.0111     0.00709
   78 hair drier       10098          74      0.0365      0.0541      0.0056     0.00279

Speed: 7.0/1.5/8.6 ms inference/NMS/total per 640x640 image at batch-size 20 Recall for val_names: tensor([0.51568, 0.48178, 0.44293], device='cuda:0')

Evaluating pycocotools mAP... saving runs/test/exp/yolov5x_coco_65_15_zsd_self_predictions.json... pycocotools unable to run: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 80 from PyObject Results saved to runs/test/exp [0.18276172723315653, 0.3208762923724822, 0.020294901101528616, 0.3624528265889396, 0.5403336046124867, 0.10132492329700706, 0.2940092284983078, 0.3952027655732882, 0.15107024279042788, 0.1186500077538415, 0.0786284506438716, 0.12871514430628675, 0.03301976264141266, 0.0111