- Setup Darknet's YOLOv4
- Train custom dataset with YOLOv4
- Create production-ready API of YOLOv4 model
- Create a web app for your YOLOv4 model
pip install opencv-python --upgrade
For Google Colab and Kaggle, use the following command-
!pip install opencv-python --upgrade
For example in my Colab notebook, the above command with output is like below-
As you can see in the last line of the output, the version of opencv-python is 4.4.0.40 which is, in fact, the latest one so our installation is done successfully. Now I will show you how can we test a pre-trained YOLOv4 model trained on coco dataset with Python and OpenCV-
Let's understand the above code snippet💭-
First I have imported the OpenCV library as cv and cv2_imshow library specific to Colab for opening image in Colab notebook.
In the next line, I have created an OpenCV model from the YOLOv4 configuration and pre-trained weights file. If you don't have these files then you can download those from this link. Here OpenCV's dnn_DetectionModel() function is all that you need for this purpose 💓
After creating the model, I did some input image preprocessing for this model like resizing the image to a specific resolution, normalizing, and maintaining the RGB format.
In the next line, I have uploaded a new unseen image where I want to detect some objects.
Next, I am iterating the names of the objects. Since our pre-trained model is trained on 80 classes known as the coco dataset, we need to take the names one by one from the file.
In the next line, I am using detect() function to detect the objects on the input image. This function is equivalent to the Darknet's detection function. It gives the object name, calculates the confidence score, and gives the bounding boxes.
Next, inside the for loop, I have written logic to put object name, confidence score, and draw a bounding box around the detected object using OpenCV inbuilt functions.
In the end, to show the image with the detection I am using the cv2_imshow() function. If you are using your own system then instead of this function use the OpenCV's imshow() function.
Now we are ready to test our image. Once I run the above code, I get the following image with the detection-
See the result, it's amazing right 💥. The pre-trained YOLOv4 model with OpenCV and Python is successfully able to detect person, wine glass, dining table, bowl, bottle with a high confidence score. In the same way, you can test your custom trained YOLOv4 model. You just need to replace YOLOv4 specific configuration file, weights, and class name file with your own, and the remaining code will be the same as it is. Let me show you the example where I have used my custom YOLOv4 model which I trained for a Global Wheat Head Detection Challenge. Since at the time of the participation OpenCV support was not released for Darknet's YOLOv4 so I had to convert my YOLOv4 model to keras/TensorFlow model and made changes accordingly. But now I can use it very easily 👲-
Wow, that was so easy 💪. For this competition, I had to put so much effort to make Darknet work in the Kaggle platform. But now with opencv-python, it is very easy for me. If you are interested to see my complete solution to the challenge you can check this link ☝.
That's it guys for today! From this post, you have learned to use your Darknet's YOLOv4 model with OpenCV and Python. Now there is no solid reason to not use this state of the art object detection and recognition neural network model in your project. The links I have shared at the starting of this blog and my solution link of a real-world object detection competition are quite enough to master in this field. So don't stop yourself 💥, try the learning from this post on your own, explore the code with experiments and in my next blog post, I will again share with you something new and exciting. Till then Go chase your dreams, have an awesome day, make every second count, and see you later in my next post😇
Data Science Course in Noida
ReplyDeleteThis concept is a good way to enhance the knowledge.thanks for sharing..
ReplyDeleteData Science
Python
Selenium
ETL Testing
AWS
Master Data Science with R & Python. Also, Learn Machine Learning & Big data. Further More Details Here-9310332343 or Visit Website-http://www.pythontrainingdelhi.com/
ReplyDeleteHere at this site really the fastidious material collection so that everybody can enjoy a lot. ExcelR Data Science Courses
ReplyDeleteThanks for sharing this Information. DATA SCIENCE Training Institute in Gurgaon
ReplyDeletePython is one of the most popular, general purpose, interpreted and high-level programming language. SOL Technologies Solutions delivers best python training institute in Delhi.
ReplyDeletePython training institute in delhi
Python training Course in delhi
Learn Python Programming Course Basic to Advanced Level - Life is Short - you Need Python Course. Further More Details Here-+91-9310332343.
ReplyDeletePython training course in Delhi
Python training institute in Delhi
Nice post. I was checking this blog and I am impressed! Extremely helpful information specially the last part I care for such info a lot.
ReplyDeletepython training course in delhi
python training Institute in delhi
Information was good,i like your post.Looking forward for more on this topic.
ReplyDeletePython training in bangalore
This comment has been removed by the author.
ReplyDeletewow! amazing blog I really like it thanks for sharing.
ReplyDeleteHow to Become a Data Scientist
Dude This really helped a lot
ReplyDeleteI will cite your blog in my project
Thank you
Thanks for reading my post. I am glad that somehow it helped you. Keep Learning :)
DeleteI really appreciate your hard work you put into your blog and detailed information you provide. Further More Information About Python training institute in Delhi Contact Here-+91-9311002620 Or Visit Website- https://www.htsindia.com/Courses/python/python-training-institute-in-south-delhi
ReplyDeleteNice article. I liked very much. All the information given by you are really helpful for my research. keep on posting your views.
ReplyDeletedata analytics course in delhi
"Very Nice Blog!!!
ReplyDeletePlease have a look about "
data science courses in delhi ncr
Online home tuition in Bangalore is the need of the hour as school learning is not enough, thus students are seeking online home tutors in Bangalore to clear their concepts.
ReplyDeleteCall Our Experts :- +91-9654271931
Visit Us:- home tuition in bangalore
I got an error like this .Can anyone help me please?
ReplyDeleteAttributeError Traceback (most recent call last)
in ()
12
13 classes, confidences, boxes = net.detect(frame, confThreshold=0.1, nmsThreshold=0.4)
---> 14 for classId, confidence, box in zip(classes.flatten(), confidences.flatten(), boxes):
15 label = '%.2f' % confidence
16 label = '%s: %s' % (names[classId],label)
AttributeError: 'tuple' object has no attribute 'flatten'
You can put a check like below just after the line no 13-
Deleteif type(classes) is not tuple:
Thanks for sharing this post if anyone looking for Core and Advanced Java training institute in delhi so contact here +91-9311002620 visit https://www.htsindia.com/java-training-courses
ReplyDeleteThank you for your informative post!!!
ReplyDeleteVillage Talkies a top-quality professional corporate video production company in Bangalore and also best explainer video company in Bangalore & animation video makers in Bangalore, Chennai, India & Maryland, Baltimore, USA provides Corporate & Brand films, Promotional, Marketing videos & Training videos, Product demo videos, Employee videos, Product video explainers, eLearning videos, 2d Animation, 3d Animation, Motion Graphics, Whiteboard Explainer videos Client Testimonial Videos, Video Presentation and more for all start-ups, industries, and corporate companies. From scripting to corporate video production services, explainer & 3d, 2d animation video production , our solutions are customized to your budget, timeline, and to meet the company goals and objectives.
As a best video production company in Bangalore, we produce quality and creative videos to our clients.
Thank you for sharing this post. Data science includes topics like statistics, data analysis, machine learning and other related methods to analyze data. Our experts in Data Science will help you in handling your Big Data and turn it into real business terms.
ReplyDeleteData Science Services in India
Interesting blog every python learners out there
ReplyDeleteFor best data science course from the best mentors of the industry visit:
Visit us: Data Science Course in Bhubaneswar
Thanks this article give more information on data science fundamentals.
ReplyDeleteVisit us: Data Science Course in Cochin
Visit us: Data Science Course in dehradun
Data Science Course in dehradun
Data Science Course in dombivli
Data Science Course in durgapur
Good information,thanks foe sharing.keep posting.
ReplyDeleteFor Online MBA check below.
Innomatics Research Labs is collaborated with JAIN (Deemed-to-be University) and offering the Online MBA in Business Intelligence,Business Analytics Program. This two-year program from JAIN (deemed-to-be) University offers foundation courses, core courses, Specialization courses, and a comprehensive master thesis intermediary, apart from an option to pursue a cross-functional and open elective.
Online MBA in Business Analytics
Online MBA in Business Intelligence
This is my first time visit here. From the tons of comments on your articles. I guess I am not only one having all the enjoyment right here.
ReplyDeleteComplete Python Programming Training Course in Delhi, India
Python training institute in delhi
Python training Course in delhi
Thanks fo sharing on technology topic, keep writing and sharing it with us.
ReplyDeleteData Science Training in Pune
Thanks for good info
ReplyDeleteData Science Course in Hyderabad
This post is so helfull and informative.keep updating with more information...
ReplyDeleteData Science Course In Mumbai
Data Science Course In Ahmedabad
Data Science Course In Kochi
Data Science Course In Trivandrum
Data Science Course In Kolkata
You completely match our expectation and the variety of our information.
ReplyDeletedata scientist course
Excellent post! I appreciate your efforts. Keep it up. If you want to promote your business globally then I can help you. Read the given links here.
ReplyDeleteKenya Trade Data
Kenya Export Data
Kenya Import Export Data Provider
Search Kenya Shipment Data
Thanks you and excellent and good to see the best software training courses for freshers and experience candidates to upgade the next level in an Software Industries Technologies,
ReplyDeletePython course in Bangalore
Python Training in Bangalore
Python Online Training in Bangalore
python training institute in Bangalore
After AI Patasala Data Science Course in Hyderabad course is completed, we will share the student's profile with the most prominent MNC firms seeking Data Science talent.
ReplyDeleteData Science Training Hyderabad
This comment has been removed by the author.
ReplyDeleteThanks for the marvelous posting! I genuinely enjooyed reading it, I want to
ReplyDeleteencourage that you continue your great writing, have a nice day!
UI Development Training in Bangalore
Data Science with Python Training in Bangalore
Python Training in Bangalore
AWS Training in Bangalore
Machine Learning With R Training in Bangalore
Data Science with R Training in Bangalore
Machine Learning with Python Training in Bangalore
Devops Training in Bangalore
Sign up today for the intensive Python Course in Hyderabad program taught by experienced trainers from AI Patasala.
ReplyDeletePython Training Hyderabad
The article was up to the point and described the information about education and learning. Thanks to blog author for wonderful and informative post.
ReplyDeleteBest Python Training in Delhi - Get 100% Placement Assistance
JOB Oriented AutoCAD 2d and 3d Course in Delhi, India
Advanced Excel Training, MIS & VBA Macros Training Institute
Job Based Java Training Institute in Delhi
Join our Online Data Science Course to analyze data, make effective predictions and gain a better understanding of market trends. Create disruptive business models for the topmost industries as we equip you with a sound business analytical & entrepreneurial ideology, alongside an excellent grasp of marketing strategies and trends.
ReplyDeleteThank You very much. It was helpful. Might below links can help u a lot. Do invest your time at it.
ReplyDeleteHS Code 0102|
HS Code 0104|
HS Code 0202|
HS Code 0203|
HS Code 0204|
HS Code 0207|
HS Code 0210|
HS Code 0303|
HS Code 0304|
HS Code 0305|
Nice article thanks for sharing this informative content.visit our related website at
ReplyDeleteBest Online Python online Certification Course in Kurnool
ITEducationalExperts - Online Training for Professional Courses With Industry Experts
I am excited to watch your upcoming posts too. it encourages me to write and i have written on some hs codes. you can check my writings.
ReplyDeleteHS Code 2201|
HS Code 2202|
HS Code 2203|
HS Code 2204|
HS Code 2205|
HS Code 2206|
HS Code 2207|
HS Code 2208|
HS Code 2209|
HS Code 2301
Usually I never comment on blogs but your article is so convincing that I never stop myself to say something about it. You’re doing a great job Man,Keep it up.
ReplyDeleteHS Code 2912|
HS Code 2914|
HS Code 2915|
HS Code 2916|
HS Code 2917|
HS Code 2918|
HS Code 2920|
HS Code 2921|
HS Code 2922|
HS Code 2923
Wow! Thank you! I constantly wanted to write on my site something like that. Can I take a portion of your post to my website? Best linux cheat sheet commands service provider.
ReplyDeleteThank You very much. It was helpful. Might below links can help u a lot. Do invest your time at it.
ReplyDeleteHS Code 0306|
HS Code 0401|
HS Code 0402|
HS Code 0403|
HS Code 0404|
HS Code 0405|
HS Code 0406|
HS Code 0407|
HS Code 0408|
HS Code 0409|
"Nice Blog! such a informative things you are sharing ,I really liked your content. If you wanna know about ""Skillslash | Training with live industry experience that gets you hired""
ReplyDeletego to Data Science Course"
Such a beautiful post you have share. I appriciate your work. I will visit your upcoming posts too. Interested can check the given links here. It can help you to find the hs codes of products.
ReplyDeleteHS Code 0806|
HS Code 0808|
HS Code 0809|
HS Code 0810|
HS Code 0812|
HS Code 0813|
HS Code 0901|
HS Code 0902|
HS Code 0904|
Yes, I am entirely agreed with this article, and I just want say that this article is very helpful and enlightening. I also have some precious piece of concerned info !!!!!!Thanks. dark0de market url
ReplyDeleteGlobal data gathers all particular data about the products, and those all elegances are more valuable for exchanging. By the export import data trading business increments quickly. Thus, trading information includes all the details about the products that might help in various ways. Get the effective exchange and make your exchanging business undeniable level. Furthermore, get the shipment in universally.
ReplyDeleteIt is very useful for me. Thanks...
ReplyDeleteAzure Databricks Online Training
Azure Databricks Online Training
Online Darknet News
ReplyDeleteRestor.live is the premier source for all things darknet news, be it important information,marketplace reviews, tor news, and uptime of popular Tor websites.
CCNA Training Institute in Gurgaon
ReplyDeleteGreat Post with valuable information. I am glad that I have visited this site. Share more updates.
ReplyDeleteMachine Learning
Python
AWS Training in Gurgaon
ReplyDelete
ReplyDeleteData Science Training Institute in Gurgaon
Hi dear,
ReplyDeleteThank you for this wonderful post. It is very informative and useful. I would like to share something here too.In 1997, a department for remote training solutions and services was created. Its activities cover the following e-learning solutions: platforms, content and services, as well as online training and on-site training for different business lines, among which are: technical computing, internet, office automation, languages, quality, environment, occupational health and safety, finance, effective presentations, team management techniques, project management and courses for every type of industry (transportation, industrial, mechanics, tourism, food, etc.).
DP-090T00: Implementing a Machine Learning Solution with Microsoft Azure Databricks
I like this article, really explained everything in the detail, keep rocking like this. i understood the topic clearly, to learn more join Data Science Course
ReplyDeleteI really enjoyed reading this article , it's really effective and interesting article python course
ReplyDeleteThanks for this post. It proves very informative for me. Great post to read. Visit my website to get best Information About Best IAS coaching Institutes in Thane.
ReplyDeleteBest IAS coaching Institutes in Thane
Top IAS coaching Institutes in Thane
ReplyDeleteData Science Training Course in Delhi
Excellent post. You have shared some wonderful tips. I completely agree with you that it is important for any blogger to help their visitors. Once your visitors find value in your content, they will come back for more What is the Python
ReplyDeleteData Science Training Institute in Noida
ReplyDeleteamazing and here some tips
ReplyDeleteGreat job for publishing such a beneficial website. premier global consulting hub
ReplyDeletefinest data science blog I've ever read. I'm grateful that you shared information about data science.
ReplyDeletedata science training in surat
It is the process of using advanced analytics to extract valuable information from data and Data Science is an interdisciplinary field that uses algorithums, procedures, and process to examine large about of data
ReplyDeleteit’s very helpful useful thanks for your valuable information follow us
ReplyDeleteBest Data Science Online Training in Hyderabad
betmatik
ReplyDeletekralbet
betpark
mobil ödeme bahis
tipobet
slot siteleri
kibris bahis siteleri
poker siteleri
bonus veren siteler
YHOQM
Python is a programming language that enables quicker work and more efficient system integration. Because of its simplicity, ease of use, and accessibility to libraries like NumPy, Pandas, and Matplotlib, it is one of the best languages used by data scientists for a variety of data science applications. You will gain a multidisciplinary skill set and be prepared to work with massive volumes of data to find insights and solutions to business challenges after completing this data science certification course. Having this certification will provide you a technical understanding of computer science and statistics in addition to a postgraduate degree. It covers the spring framework, hibernate, and advanced java.best data science institute in nashik with placement
ReplyDeleteThe blog post you shared here with us is very informative. Course MS-740: Troubleshooting Microsoft Teams
ReplyDeleteThanks for sharing the valuable information.
ReplyDeleteHome Nursing Services in Hyderabad
nursing services at your door step
Home Physiotherapy Services
Great job for publishing such a beneficial post, The excellent Databricks training from TotalCloudAI will improve your data abilities and professional chances with its comprehensive, hands-on learning approach. For more information visit us!
ReplyDeleteGreat job for publishing such a beneficial post, The excellent Databricks training courses from TotalCloudAI will improve your data abilities and professional chances with its comprehensive, hands-on learning approach. For more information visit us!
ReplyDeletecbvcxbvxcnbcvn
ReplyDeleteشركة مكافحة الحمام
rtghrdhgdhnfgjhn
ReplyDeleteشركة مكافحة الحمام
شركة كشف تسربات المياه بالقطيف H1c9Gfvxcv
ReplyDeleteشركة صيانة افران بجازان UaV34oZZae
ReplyDeleteThank for good information
ReplyDeletehttps://www.iihtsrt.com/