# Try Darknet Detect (Machine Learning Inference) on Sample Images with Pre-Trained Weights ###### tags: `2022/06` `darknet samples` `inference` `pre-trained weights` > <ins>(2022/6/19) Try Darknet Machine Learning Inference, using Darknet pre-trained weights on sample images. Will do training in next section</ins> --- ## :memo: Table of Contents [TOC] ## :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 - [Official Darknet wiki](https://github.com/AlexeyAB/darknet/wiki) : This is very brief, not easy to get a good overview from this wiki to newbies. We can come back later only when needed. - [Official Darknet github](https://github.com/AlexeyAB/darknet) : ==This github is the official Darknet document== and contains comprehensive information and we will come back to this quite often. [Section - How to compile on Linux (using make)](https://github.com/AlexeyAB/darknet#how-to-compile-on-linux-using-make) contains couples of resources which are more friendly to newbies which I add in below. - [Youtube - YOLOv4 in the CLOUD (Google Colab): Install and Run Object Detector](https://www.youtube.com/watch?v=mKAEGSxwOAY) This video illustrates the Colab Darknet sample program below step by step, very intuitive. - [Running a YOLOv4 Object Detector with Darknet in the Cloud (Google Colab GPU Enabled ipynb)](https://colab.research.google.com/drive/12QusaaRj_lUwCGDvQNfICpa7kA7_a2dE) : Google Colab requires (mostly free of charge) Google account with GPU hardware (time limit). ==We will focus on this ipynb to start with==. ## :memo: Try on Google Colab [Google Colab](https://colab.research.google.com/) 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))](https://colab.research.google.com/drive/12QusaaRj_lUwCGDvQNfICpa7kA7_a2dE) 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:](https://hackmd.io/@MarconiJiang/install_darknet) [:arrow_up:back to marconi's blog:arrow_up:](https://marconi1964.github.io/) [:arrow_right:Next article - Darknet Training(1):arrow_right:](https://hackmd.io/@MarconiJiang/darknet_training)