Closed Kian-Strasser closed 3 years ago
I have got the same problem, could you solve it ?
Traceback (most recent call last): File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/topics.py", line 750, in _invoke_callback cb(msg) File "droneui.py", line 393, in cameraCallback self.show_detector() File "droneui.py", line 558, in show_detector detections = darknet.detect_image(netMain, metaMain, darknet_image, thresh=0.25) File "/home/drone1/darknet/darknet.py", line 174, in detect_image do_nms_sort(detections, num, len(class_names), nms) TypeError: object of type 'METADATA' has no len()
Same problem here, is there any solution so far?
Same problem. Have anyone solved it?
Hey I tried to use yolov4 on my webcam with this code:
from ctypes import * # Import libraries import math import random import os import cv2 import numpy as np import time import darknet
def convertBack(x, y, w, h): xmin = int(round(x - (w / 2))) xmax = int(round(x + (w / 2))) ymin = int(round(y - (h / 2))) ymax = int(round(y + (h / 2))) return xmin, ymin, xmax, ymax
def cvDrawBoxes(detections, img):
Colored labels dictionary
netMain = None metaMain = None altNames = None
def YOLO():
if name == "main":
YOLO() # Calls the main function YOLO()
But I get the error: Traceback (most recent call last): File "darknet_video_mod.py", line 150, in
YOLO() # Calls the main function YOLO()
File "darknet_video_mod.py", line 138, in YOLO
detections = darknet.detect_image(netMain, metaMain, darknet_image, thresh=0.25) # Detection occurs at this line and return detections, for customize we can change the threshold.
File "C:\yolo_v4\darknet\build\darknet\x64\darknet.py", line 173, in detect_image
do_nms_sort(detections, num, len(class_names), nms)
TypeError: object of type 'METADATA' has no len()
[ WARN:0] terminating async callback
Can you please help me.