← Back to list

Python VS COVID-19

Did an AI detection system help us get through COVID-19?

Jonathan Aguilar Cruz · 2026-02-06 05:28 · 6 claps · 4.0 min read
#python #data-science #yolov4 #covid19
Open on Medium ↗
Wiki topics: ML · Machine Learning 🔬 · Science · General

Python VS COVID-19

Did an AI detection system help us get through COVID-19?

Storytime

In 2020 Senior Fronted developer, *Ravindu Senaratne*, created a system that would implement social distancing during our COVID-19 period. This system started as a project to help practice social distancing in large crowds due to COVID-19 cases increasing dramatically in 2020.

System?

What system did he create ? It’s actually a really fascinating system that can track live footage of other people to calculate whether they are practicing or using social distance which was at least 6 feet apart from one to another. By using python and components like YOLOv4, Darknet, and OpenCV he was able to code a the system that would be capable of going against COVID-19.

Time to gear up…

So at first I asked myself how is something that is non-contact going to defeat a virus that involves you to get into contact. Well Ravindu Senaratne did not want to get near COVID-19 just like many of us around the world agreed on. His main goal was to help people reduce the risks of getting in contact and by using the following …

  • The latest version of python
  • YOLOv4 — Also known as “You Only Look Once” is an object detecting system used to recognize various objects in a single frame.
  • CUDA Toolkit — A High performance GPU acceleration application that is used to help our system keep up with many tasks that can be presented all at once.
  • OpenCV — A library that can be implemented into our coding script for image processing.
  • Darknet — This can be seen as a training module or booster for our YOLOv4 system to help the system function faster and more accurate with its detection availability.

His system was able to use live footage to calculate the distance of not only 2 people but a whole crowd and notify the user if and how many were in risk of COVID-19. In order to notify the user Ravindu Senaratne created two points 6 feet apart and named that variable Euclidean Distance.

https://heartbeat.comet.ml/social-distance-detector-with-python-yolov4-darknet-and-opencv-62e66c15c2a4

https://heartbeat.comet.ml/social-distance-detector-with-python-yolov4-darknet-and-opencv-62e66c15c2a4

Using the Euclidean distance he was able to take point x and y and create a w, and h point (width and height) to convert our two points into the center of rectangles which will allow our system to use that frame as multiple objects detected. This was known converting as center coordinates to rectangle coordinates.

https://heartbeat.comet.ml/social-distance-detector-with-python-yolov4-darknet-and-opencv-62e66c15c2a4

https://heartbeat.comet.ml/social-distance-detector-with-python-yolov4-darknet-and-opencv-62e66c15c2a4

The thing with YOLOv4 is that its able to detect objects by putting the objects into class functions and the thing with class functions is you cannot have repeated strings so he was able to filter each person individually and not as a whole crowd which help the YOLOv4 and OpenCV detect many classes at once which in the case of our situation it'll be every individual person other than a whole crowd.

https://heartbeat.comet.ml/social-distance-detector-with-python-yolov4-darknet-and-opencv-62e66c15c2a4

https://heartbeat.comet.ml/social-distance-detector-with-python-yolov4-darknet-and-opencv-62e66c15c2a4

The last step was to figure out a way to notify the user when and where people are being at risk. He portrayed a text within the live footage of the YOLOv4 system called “No of at-risk people” this would show how many people were close in contact and were being tracked by red boxes while the ones who were not in contact were tracked by green boxes showing they are safe.

https://heartbeat.comet.ml/social-distance-detector-with-python-yolov4-darknet-and-opencv-62e66c15c2a4

https://heartbeat.comet.ml/social-distance-detector-with-python-yolov4-darknet-and-opencv-62e66c15c2a4

https://heartbeat.comet.ml/social-distance-detector-with-python-yolov4-darknet-and-opencv-62e66c15c2a4

https://heartbeat.comet.ml/social-distance-detector-with-python-yolov4-darknet-and-opencv-62e66c15c2a4

Who won?

Unfortunalty we know the answer to this question. COVID-19 continued to spread across the world but **Ravindu Senaratne **was on the right track with his project. This project was the start of something big, later on schools were able to implement thermal video footage to display the temperature of every student who would walk in through school. This is something that many others were probably able to use as a starter for ideas like this or more.

Can we make this better? How?

This is already a really good project for a good cause and considering the fact that this was made at peak of COVID-19 period it was only the start of something. I think what could have made this system better at the time is maybe using YOLOv4 and Darknet system to generate a live path or control traffic so that people are able to follow at a normal walking speed and as well as prevent getting in contact with others leading to a decrease of COVID-19 risk factors.

Conclusion

This project by **Ravindu Senaratne was made with good intentions and its ideas like this that can make the world a better place. I would have definitely promoted this to be used or at least practice in crowded areas so that people are aware of how many factors they should be aware of when going out. Covid-19 was really hard for many of us and seeing this project and [Ravindu Senaratne](https://medium.com/@ravindusenaratne?source=post_page---byline--62e66c15c2a4---------------------------------------) **taking initiative to create something better and help the world really shows that many of us do and did care during hard times like Covid-19.

Thank You **Ravindu Senaratne.**

Resources/Article


메타데이터
post_id
0e6dba7b4979
slug
python-vs-covid-19-0e6dba7b4979
url
https://medium.com/@aguilarcruz/python-vs-covid-19-0e6dba7b4979
canonical_url
https://medium.com/@aguilarcruz/python-vs-covid-19-0e6dba7b4979
author_url
https://medium.com/@aguilarcruz
status
ok
fetched_at
2026-07-15 23:32:13