YOLO doesn’t see a poppy?

I’m excited to start playing with You Only Look Once, https://pjreddie.com/darknet/yolo/.

The installation instructions worked beautifully:

% git clone https://github.com/pjreddie/darknet
% cd darknet
% make
% wget https://data.pjreddie.com/files/yolov3.weights
% ./darknet detect cfg/yolov3.cfg yolov3.weights data/dog.jpg
...
data/dog.jpg: Predicted in 0.334838 seconds.
dog: 57%
car: 52%
truck: 56%
car: 62%
bicycle: 59%

Neat! I think this also my first time encountering this license: https://github.com/pjreddie/darknet/blob/master/LICENSE.fuck.

One little project I have in mind for this to identify which regions in my photos correspond to flowers to allow me in turn to calculate the “average” color for the flower.

E.g., here’s an image of a California poppy — part of a patch I helped with planting near the orchard:

Some California poppies near the orchard in downtown Los Altos

Feeding it into darknet with the default threshold of 0.25 was yielding nothing. Bumping that down to 0.01 (and then 0.005) we finally get it to say something:

% ./darknet detect cfg/yolov3.cfg yolov3.weights $HOME/Downloads/poppies.jpg -thresh 0.005
...
carrot: 1%
umbrella: 1%
umbrella: 2%

Here are the corresponding bounding boxes:

A photo of California poppies, annotated as being an umbrella, a woodchip marked as a carrot, and again a larger enclosing area marked as an umbrella.

Trying again with an image of some lantana flowers from a local school garden:

Red-orange lantana flowers surrounded by green leaves.
% ./darknet detect cfg/yolov3.cfg yolov3.weights /Users/dfaden/Downloads/lantana_flowers.jpg -thresh 0.005
...
bench: 1%
suitcase: 1%
teddy bear: 1%
pottedplant: 1%
person: 1%
person: 1%
person: 1%
apple: 1%
sports ball: 1%
person: 2%
carrot: 1%
broccoli: 2%
cake: 9%
orange: 1%
person: 3%
chair: 1%
chair: 1%
bed: 1%
Red-orange lantana flowers surrounded by green leaves, overlayed with rectangles showing things identified in the image: "orange", "carrot", "teddy bear".

Hm… well, will look forward to tinkering with this more.

Also, here’s a neat series of videos from the creator: The Ancient Secrets of Computer Vision, which I heard about via this Reddit thread: https://www.reddit.com/r/computervision/comments/1nl3nqu/computer_vision_learning_resources/.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *