You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
错误:show_result(img, result, model.CLASSES)
File "yolodet-pytorch/yolodet/apis/inference.py", line 168, in show_result
label = rslt['label']
IndexError: too many indices for tensor of dimension 3
代码:
from yolodet.apis.inference import inference_detector,init_detector,show_result
import os
build the model from a config file and a checkpoint file
model = init_detector(config_file, checkpoint_file, device='cuda:0')
test a single image and show the results
img ='test.jpg' # or img = mmcv.imread(img), which will only load it once
result,t = inference_detector(model, img)
print('%s Done , object num : %s .time:(%.3fs)' % (img,len(result), t))
visualize the results in a new window
show_result(img, result, model.CLASSES)
The text was updated successfully, but these errors were encountered:
错误:show_result(img, result, model.CLASSES)
File "yolodet-pytorch/yolodet/apis/inference.py", line 168, in show_result
label = rslt['label']
IndexError: too many indices for tensor of dimension 3
代码:
from yolodet.apis.inference import inference_detector,init_detector,show_result
import os
config_file ='cfg/yolov4_gpu.py'
checkpoint_file ='work_dirs/yolov4/latest.pth'
build the model from a config file and a checkpoint file
model = init_detector(config_file, checkpoint_file, device='cuda:0')
test a single image and show the results
img ='test.jpg' # or img = mmcv.imread(img), which will only load it once
result,t = inference_detector(model, img)
print('%s Done , object num : %s .time:(%.3fs)' % (img,len(result), t))
visualize the results in a new window
show_result(img, result, model.CLASSES)
The text was updated successfully, but these errors were encountered: