lx-cly / YOLOv7_OBB

YOLOv7+KLD
GNU General Public License v3.0
35 stars 8 forks source link

Label visualization problems in test.py #3

Open jsago opened 1 year ago

jsago commented 1 year ago

I want to know whether the code of test.py has not been modified,The proportion of the gt box in the visualization image becomes thinner,It's strange, but it's not like this in detect.py,and labels in the .txt format are only horizontal boxes, and only four coordinate parameters are included image image image image

lx-cly commented 1 year ago

when creating val_dataloader,the sign of rect is opened. the targets normalized to pixel format is wrong. Now,rect=False,the gt box in visualization is correct.And in detect.py, I just save hbb pred results in the .txt format and save poly pred results in the .json format.If you want to get obb results, please save the json format.

jsago commented 1 year ago

when creating val_dataloader,the sign of rect is opened. the targets normalized to pixel format is wrong. Now,rect=False,the gt box in visualization is correct.And in detect.py, I just save hbb pred results in the .txt format and save poly pred results in the .json format.If you want to get obb results, please save the json format.

Thank you very much for removing my doubts. I have another question. I hope I can get your answer. When I set task to speed or study in test.py, an error is reported: Traceback (most recent call last): File "D:/Scientific_Research/YOLOv7_OBB_KLD/my_test.py", line 404, in plots=False, v5_metric=opt.v5_metric) File "D:/Scientific_Research/YOLOv7_OBB_KLD/my_test.py", line 60, in test model = attempt_load(weights, map_location=device) # load FP32 model File "D:\Scientific_Research\YOLOv7_OBB_KLD\models\experimental.py", line 252, in attempt_load ckpt = torch.load(w, map_location=map_location) # load File "D:\Software Area\Anaconda\envs\Pytorch\lib\site-packages\torch\serialization.py", line 579, in load with _open_file_like(f, 'rb') as opened_file: File "D:\Software Area\Anaconda\envs\Pytorch\lib\site-packages\torch\serialization.py", line 230, in _open_file_like return _open_file(name_or_buffer, mode) File "D:\Software Area\Anaconda\envs\Pytorch\lib\site-packages\torch\serialization.py", line 211, in init super(_open_file, self).init(open(name, mode)) PermissionError: [Errno 13] Permission denied: '.'

lx-cly commented 1 year ago

when creating val_dataloader,the sign of rect is opened. the targets normalized to pixel format is wrong. Now,rect=False,the gt box in visualization is correct.And in detect.py, I just save hbb pred results in the .txt format and save poly pred results in the .json format.If you want to get obb results, please save the json format.

Thank you very much for removing my doubts. I have another question. I hope I can get your answer. When I set task to speed or study in test.py, an error is reported: Traceback (most recent call last): File "D:/Scientific_Research/YOLOv7_OBB_KLD/my_test.py", line 404, in plots=False, v5_metric=opt.v5_metric) File "D:/Scientific_Research/YOLOv7_OBB_KLD/my_test.py", line 60, in test model = attempt_load(weights, map_location=device) # load FP32 model File "D:\Scientific_Research\YOLOv7_OBB_KLD\models\experimental.py", line 252, in attempt_load ckpt = torch.load(w, map_location=map_location) # load File "D:\Software Area\Anaconda\envs\Pytorch\lib\site-packages\torch\serialization.py", line 579, in load with _open_file_like(f, 'rb') as opened_file: File "D:\Software Area\Anaconda\envs\Pytorch\lib\site-packages\torch\serialization.py", line 230, in _open_file_like return _open_file(name_or_buffer, mode) File "D:\Software Area\Anaconda\envs\Pytorch\lib\site-packages\torch\serialization.py", line 211, in init super(_open_file, self).init(open(name, mode)) PermissionError: [Errno 13] Permission denied: '.'

when you set task to speed or study in test.py,parser.add_argument('--weights'...) default=['{your_weigthts}']. elif opt.task == 'speed': # speed benchmarks **for w in opt.weights**: