Thumbnail

Darknet YOLO (Obj Detection)

Avatarptp

You only look once (YOLO) is a state-of-the-art, real-time object detection system. using Tiny YOLOv3 a very small model as well for constrained environments (CPU Only, NO GPU)

Requires ARC v5 (Updated 11/3/2020)

How to add the Darknet YOLO (Obj Detection) robot skill

  1. Load the most recent release of ARC (Get ARC).
  2. Press the Project tab from the top menu bar in ARC.
  3. Press Add Robot Skill from the button ribbon bar in ARC.
  4. Choose the Camera category tab.
  5. Press the Darknet YOLO (Obj Detection) icon to add the robot skill to your project.

Don't have a robot yet?

Follow the Getting Started Guide to build a robot and use the Darknet YOLO (Obj Detection) robot skill.


How to use the Darknet YOLO (Obj Detection) robot skill

You only look once (YOLO) is a state-of-the-art, real-time object detection system. using Tiny YOLOv3 a very small model as well for constrained environments (CPU Only, NO GPU)

Darket YOLO website: https://pjreddie.com/darknet/yolo/

Requirements: You only need a camera control, the detection is done offline (no cloud services).

User-inserted image

User-inserted image

  1. start the camera.
  2. check the Running (check box)

The detection will run continuously when the detection results change an On Changes script is executed (check the configuration area):

User-inserted image

  1. Press config
  2. Edit the on changes script
  3. on changes Javascript script

you can run the detection on demand, javascript:

controlCommand("Darknet YOLO", "Run");

The above command runs the configured on demand script.

An example of script:

var numberOfRegions=getVar('$YOLONumberOfRegions');
if (numberOfRegions==0)
{
   Audio.sayWait('No regions found');
}
else
{
   Audio.sayWait('Found ' + numberOfRegions + ' regions');
        var classes = getVar('$YOLOClasses');
        var scores = getVar('$YOLOScores');
        for(var ix=0; ix        {
           Audio.sayWait('Found ' + classes[ix] + ' with score: ' + (classes[ix]*100) + '%');
   }
}

ARC Pro

Upgrade to ARC Pro

Don't limit your robot's potential – subscribe to ARC Pro and transform it into a dynamic, intelligent machine.

#25   — Edited

I have a few questions for PTP.

  1. Without a GPU how many frames per second/ per minute are people getting with this arrangement?
  2. I have a GPU on my laptop, but you said that this code won't utilize it. Is that right?
  3. What about the Latte Panda, how can such a tiny machine run this CPU/GPU intensive code?
  4. How do they get object classification to run so fast on products like HuskeyLens? I get about 1 or 2 FPS on that device.
PRO
USA
#26  

NUC Core I7  4 fps with a dummy javascript script i.e. comments only

User-inserted image

2) Correct. This version does not use GPU, also is using the tiny model, less accurate but lighter.

3) No tests yet. I've used Atomic PI (similar to Latte panda entry model) but is running ROS, I got a new one and I plan to install Windows, ARC and the plugin, I can guess the performance will be worst.

4) I'll address in another post.

PRO
USA
#27  

Quote:

4. How do they get object classification to run so fast on products like HuskeyLens? I get about 1 or 2 FPS on that device.
HuskeyLens uses a SoC (System on chip) Kendryte K210 and the video capture is handled/processed directly on the pcb. You can read more about the chip here: https://www.seeedstudio.com/blog/2019/09/12/get-started-with-k210-hardware-and-programming-environment/ https://hackaday.com/2019/11/04/how-smart-are-ai-chips-really/

User-inserted image

so basically is a dual risc with a KPU:

Quote:

KPU is a general-purpose neural network processor with built-in convolution, batch normalization, activation, and pooling operations. It can detect faces or objects in real time
The K210 is not new (2019) is from a Chinese manufacturer, it's a good choice for IOT scenarios i.e. (no PC) , power and budget constrains. I don't like DFRobot approach they  mentioned and advertised as an open source product but later they changed to "to be open source later".

So if you are designing solutions for IOT and pairing with other micro-controllers it's good choice, everything is glue together (camera on board), serial communication, product support etc.

PRO
USA
#28  

Regarding Robots in general If you plan to have an embedded computer, operating system, additional software e.g. ARC or ROS you will need additional hardware: GPU or a TPU.

If you are building real robots or creating products:

  1. you don't pick a Windows Desktop for a Robot.
  2. For an embedded computer you pick ARM and not an Intel architecture. Intel arch is too much complicated. Only works if you have a good design (more money) to accommodate battery power, heat dissipation, space and additional hardware e.g. GPUS.

That is of my opinion, also is the reason why ROS works very well on Linux. If you need to develop a windows driver, or something low level is a pain in neck you need to deal with all the safe protections e.g. drivers certificates and closed APIs. Also a good portion of CPU is used for user interface and other user features not relevant for a Robot.

ARC/Builder's user base expects an aasy (EZ) software to run the robots with a friendly operating system i.e. Windows plus a friendly off the shelf controller (EZ-Robot) with no extra soldering or extra changes.

There was a Raspberry PI version now is gone, similar scenario for EZ-Robot controller replacement i.e. Arduino Firmwares, you can do a lot of new stuff... but requires coding not an easy task for most forum users so most people will wait for Synthiam to add the required features.

Regarding TPUs there are some low cost solutions running on Linux, and some are ported (being fixed) to run on windows.

Hopefully they will become more Windows friendly and combined with Lattepandas / Upboards will become a solution for Windows + ARC users.

#30   — Edited

ptp,

I Downloaded and installed your skill and it works PERFECTLY!!! In the past I installed YOLO/Darknet and it took me 2 weeks to get it right. This time it took less than two minutes! I get 8 FPS.

I made some changes to your javascript code that works better for me. I wanted to just announce the object/objects that it sees.

Again thank you for all your hard work in getting this skill up and going!!!!!

--Thomas

var numberOfRegions=getVar('$YOLONumberOfRegions');
            if (numberOfRegions==0)
            {
            }
            else
            {
                var classes = getVar('$YOLOClasses');
                for(var ix=0; ix                {
                  Audio.sayWait('I see a ' + classes[ix]);
                }
            }
#31  

PS. Do you have a list of all of the objects that it can detect?

#32  

PPS. FEATURE REQUEST: Can you give us the coordinates of the bounding boxes, or at least the center of the bounding boxes?