3

https://github.com/arunponnusamy/cvlib/tree/f46a22f8e13bc4b0267b9057fa88de170d41f96a

I'm checking examples of cvlib and trying on my own on spyder Python 3.7 Face detection is working very fine.. Gender detection working very fine but object detection is not working... Output is the image itself. I have tried BGR2RGB but nothing happens.

here is code

import cvlib as cv
from cvlib.object_detection import draw_bbox 
import cv2
path = r'C:\Users\user\desktop\cod\object_detection_input.jpg'
image = cv2.imread(path)
bbox, label, conf = cv.detect_common_objects(image)
print(bbox, label, conf)
out = draw_bbox(image, bbox, label, conf)
cv2.imshow("object_detection", out)
cv2.waitKey()
cv2.destroyAllWindows()
Emre
  • 81
  • 2
  • 8

2 Answers2

1

If the function return empty list, the probable reason is problems in yolov3.cfg, yolov3.weights files that train the model (yolov3.weights is 242 mg file).

In windows these files should be in folder:

C:\Users\USER_NAME\.cvlib\object_detection\yolo\yolov3 

The files are download in the first time the function work. If the files are corrupted, the function will not work but also will not throw an error!!

fix: Delete these files and run the function again you will see download of both files.

Citizen-Dror
  • 843
  • 9
  • 17
0

I Guess the problem about kernel restart after installation of libraries. When I restart computer. It worked.

Emre
  • 81
  • 2
  • 8