bnosac / image

Computer Vision and Image Recognition algorithms for R users
274 stars 65 forks source link

Image detection failed with yolo_tiny_coco #3

Closed rmenoli closed 7 years ago

rmenoli commented 7 years ago

Hi! I tried to make detection with this two models: yolo_tiny_voc and yolo_tiny_coco. The first model detect the object but the second one don't detect anything. The code I used is it:

yolo_tiny_voc <- image_darknet_model(type = 'detect', 
                                     model = "tiny-yolo-voc.cfg", 
                                     weights = system.file(package="image.darknet", "models", "tiny-yolo-voc.weights"), 
                                     labels = system.file(package="image.darknet", "include", "darknet", "data", "voc.names"))
yolo_tiny_voc

x <- image_darknet_detect("__path__", object = yolo_tiny_voc)

###################################
yolo_tiny_coco <- image_darknet_model(type = 'detect', 
                                     model = "tiny-yolo-voc.cfg", 
                                     weights = system.file(package="image.darknet", "models", "tiny-yolo.weights"),
                                     labels = system.file(package="image.darknet", "include", "darknet", "data", "coco.names"))

##
x <- image_darknet_detect("__path__", object = yolo_tiny_coco)

I would find a model with 80 labels that works in a detection model. I found only a model with 20 labels that works for detection.

Thank you

jwijffels commented 7 years ago

Please share also the image to make this reproducible.

jwijffels commented 7 years ago

You should look at the help of ?image_darknet_model for ready-made-models and the corresponding labels.

rmenoli commented 7 years ago

For any image I tried. yolo_tiny_voc detected correctly in the 20 labels . The output of yolo_tiny_coco is always: Boxes: 845 of which 0 above the threshold. I tired about 20/25 images. An example: https://www.google.it/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8&ved=0ahUKEwiXhNrZh83VAhXD5xoKHZr_BTUQjRwIBw&url=http%3A%2F%2Feslamoda.com%2F25-divertidas-fotos-que-toda-chica-debe-tener-con-su-mejor-amiga&psig=AFQjCNG1DVRKs-xp_2Mmv6CLD8_PRbPEhA&ust=1502467992926158 yolo_tiny_voc detect 2 person. yolo_tiny_coco detect 0 object.

jwijffels commented 7 years ago

Please make your example reproducible and use the correct model configuration, trained weights and labels. For pretrained labels, have a look at https://pjreddie.com/darknet/yolo