Try   HackMD

Try Darknet Detect (Machine Learning Inference) on Sample Images with Pre-Trained Weights

tags: 2022/06 darknet samples inference pre-trained weights

(2022/6/19) Try Darknet Machine Learning Inference, using Darknet pre-trained weights on sample images. Will do training in next section


:memo: Table of Contents

:memo: Darknet Documentation and Resources

Darknet is the deep learning framework implemented by author of YOLO. However, it was later maintained by Russian AlexeyAB. YOLO v4 was introduced by Alexey Bochkovskiy and Chien-Yao Wang and Hong-Yuan Mark Liao.

It requires compilation (make on Linux, or different in other OS) from source code on github, as we did in previous section.

Let's check the resources available for Darknet

:memo: Try on Google Colab

Google Colab is a Cloud application similar to Jyputer Notebook for machine learning applications. It is hosted by Google, so requires Google account. It is free with limited hour usage, which is enough for beginners. I am using server, which is very similar to using Colab, except for limitations on multimedia interfaces, including images, video, camera, audio, etc. It requires special handling for those data. Other than that, it is very handy, and can deploy easily from everywhere the internet is available.

I use Colab - Running a YOLOv4 Object Detector with Darknet on Colab and GPU Enabled ipynb (iPython Notebook)) as rerence and implement it on my server. You may try Colab with this link, then File - Save a copy in Drive for your personal copy for execution and storage, (assume you had created a Google account). There are many articles available about Google Colab over internet, so I will leave it to yourself, and focus on Darknet only.

:memo: First Darknet Practice - Inference

$ git clone https://github.com/AlexeyAB/darknet
$ cd darknet
# Change the setting to enable GPU
$ sed -i "s/GPU=0/GPU=1/g" Makefile
$ sed -i "s/CUDNN_HALF=0/CUDNN_HALF=1/g" Makefile
$ sed -i "s/CUDNN=0/CUDNN=1/g" Makefile
$ sed -i "s/OPENCV=0/OPENCV=1/g" Makefile
$ make

:arrow_left:Previous article - Install Darknet:arrow_left: :arrow_up:back to marconi's blog:arrow_up: :arrow_right:Next article - Darknet Training(1):arrow_right: