Skip to content

Commit 47dd133

Browse files
Pradyoth S PPradyoth S P
authored andcommitted
updaged README.md
1 parent cb50259 commit 47dd133

File tree

10 files changed

+137
-1
lines changed

10 files changed

+137
-1
lines changed

README.md

Lines changed: 137 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,137 @@
1-
# object_detection_using_multiprocessing
1+
# Person Detection Using Embarrassingly Parallel Computing report
2+
3+
This project aims to demonstrate the use of embarrassingly parallel computing techniques for detecting persons in video frames.
4+
5+
# ****Project Overview****
6+
7+
In this project, we will use the parallel processing capabilities of a multi-core processor or a GPU to speed up the process of detecting persons in video frames. We will be using a pre-trained deep learning model for object detection, specifically the **[YOLOv3](https://pjreddie.com/darknet/yolo/)** model.
8+
9+
We will compare the performance of the parallelized version of the person detection pipeline with a non-parallelized version to see the speedup achieved by using parallel processing.
10+
11+
# ****Dependencies****
12+
13+
- Python v3.8
14+
- IDE (PyCharm, Jupyter Notebook)
15+
- ImageAI
16+
- TensorFlow v2.4.0
17+
- OpenCV
18+
- Keras
19+
- NumPy
20+
- Pillow
21+
- SciPy
22+
- H5py
23+
- Matplotlib
24+
25+
# ****Running the Code****
26+
27+
```bash
28+
git clone git@github.com:Pradyothsp/person-detection-using-embarrassingly-parallel-computating.git
29+
cd person-detection-using-embarrassingly-parallel-computating
30+
```
31+
32+
Next, download pre-trained model from [here](https://github.com/OlafenwaMoses/ImageAI/releases/download/1.0/yolo.h5/), and place it in a folder `model`.
33+
34+
Create folder `media` and other folders like shown below:
35+
36+
![Untitled](images/Untitled.png)
37+
38+
Install all the requirements using command:
39+
40+
```bash
41+
pip3 install -r requirements.txt
42+
```
43+
44+
To run the person detection using serial, use the following command:
45+
46+
```bash
47+
python3 main_s.py
48+
```
49+
50+
To run person detection using parallel (v1 and v2), use the command:
51+
52+
```bash
53+
python3 main_v1.py
54+
# or
55+
python3 main_v2.py
56+
```
57+
58+
# Methodology
59+
60+
## Architecture Diagram
61+
62+
![images/image1.png](images/image1.png)
63+
64+
Figure : Serial Computing
65+
66+
![images/image2.png](images/image2.png)
67+
68+
Figure : Parallel Computing (v1)
69+
70+
![images/image3.png](images/image3.png)
71+
72+
## Hardware Implementation
73+
74+
I am implementing this project on a MacBook Pro (2019) with 8 cores, which has an Intel i5 (8th generation) processor and 8 GB RAM. This laptop also has an SSD for reading and writing videos or images.
75+
76+
# 2. Methodology
77+
78+
The methodology for implementing person detection using embarrassingly parallel computing involves the following steps:
79+
80+
1. Select a person detection algorithm that can be easily parallelized. This could be a traditional computer vision algorithm or a deep learning model, such as YOLOv3 or RetinaNet. Here I am using YOLOv3.
81+
2. I am implementing parallelism in 2 ways:
82+
- **Version 1:** Read the video using cv2, parse each frame, pass each image array to each core, and run the person detection function on each core.
83+
- **Version 2:** Parse each frame from a video and save each frame as an image. Pass each image location to each core and run a person detection algorithm and save the detected image. Then stitch all the images back into the video.
84+
3. Evaluate the performance of the parallelized person detection algorithm. This could involve running experiments on a set of images or video streams, measuring the time required to perform person detection and the accuracy of the detection results.
85+
4. Compare the performance of the parallelized person detection algorithm with that of a non-parallelized algorithm. This could involve running the same experiments with a non-parallelized version of the person detection algorithm, and comparing the results to those obtained with the parallelized algorithm.
86+
87+
Overall, this methodology provides a general framework for implementing person detection using embarrassingly parallel computing and can be adapted to specific scenarios and applications as needed.
88+
89+
# Numerical Result
90+
91+
| | Person Detection |
92+
| --- | --- |
93+
| Serial - time taken in sec | 1176.34 |
94+
| Parallel (Version 1) - time taken in sec | 861.45 |
95+
| Parallel (Version 2) - time taken in sec | 485.22 |
96+
| Speedup (Version 1) | 1.365534854 |
97+
| Speedup (Version 2) | 2.424343597 |
98+
| Efficiency (Version 1) | 17.06918568 |
99+
| Efficiency (Version 2) | 30.30429496 |
100+
101+
![images/image4.png](images/image4.png)
102+
103+
![images/image5.png](images/image5.png)
104+
105+
Figure : Results – Speedup Figure : Results – Efficiency
106+
107+
![images/image6.png](images/image6.png)
108+
109+
Figure : Results - Time Taken
110+
111+
These results indicate that using embarrassingly parallel computing techniques can significantly improve the performance of a person detection algorithm. The serial version of the algorithm took 1176.34 seconds to run, while the parallel versions took 861.45 seconds (Version 1) and 485.22 seconds (Version 2) to run. This represents a speedup of 1.36x and 2.42x, respectively, compared to the serial version.
112+
113+
In terms of efficiency, the first parallel version had an efficiency of 17.06%, while the second version had an efficiency of 30.30%. This means that the second parallel version was more efficient at utilizing the available computational resources to improve the performance of the algorithm.
114+
115+
These results suggest that using embarrassingly parallel computing can be an effective way to improve the performance of person detection algorithms and potentially reduce the time and computational resources required for such tasks.
116+
117+
![images/image7.jpeg](images/image7.jpeg)
118+
119+
![images/image8.jpeg](images/image8.jpeg)
120+
121+
Figure : Original Frame Figure : Detected Frame
122+
123+
The above figure 7 is the original image and figure 8 is the person detected image of YOLOv3.
124+
125+
# 4. Conclusion
126+
127+
In conclusion, person detection using embarrassingly parallel computing can be an effective way to accelerate the process of detecting people in images or video streams. By dividing the workload into many independent tasks that can be run simultaneously on multiple processors or computers, it is possible to significantly reduce the time required to perform person detection. However, the success of this approach will depend on the complexity of the person detection algorithm and the availability of sufficient computational resources. In general, using embarrassingly parallel computing can be a valuable tool for speeding up person detection in certain scenarios.
128+
129+
# ****Acknowledgements****
130+
131+
- Python3: [https://www.python.org](https://www.python.org/)
132+
- YOLOv3: [https://arxiv.org/abs/1804.02767](https://arxiv.org/abs/1804.02767)
133+
- ImageAI: [https://github.com/OlafenwaMoses/ImageAI/](https://github.com/OlafenwaMoses/ImageAI/)
134+
- OpenCV: [https://github.com/opencv/opencv-python](https://github.com/opencv/opencv-python)
135+
- Multiprocessing: [https://docs.python.org/3/library/multiprocessing.html](https://docs.python.org/3/library/multiprocessing.html)
136+
- Darknet: [https://pjreddie.com/darknet/](https://pjreddie.com/darknet/)
137+
- Testing Video: [https://www.pexels.com/search/videos/times%20square/](https://www.pexels.com/search/videos/times%20square/)

images/Untitled.png

28.5 KB
Loading

images/image1.png

40.1 KB
Loading

images/image2.png

57.7 KB
Loading

images/image3.png

76.4 KB
Loading

images/image4.png

27.3 KB
Loading

images/image5.png

21.1 KB
Loading

images/image6.png

27.3 KB
Loading

images/image7.jpeg

137 KB
Loading

images/image8.jpeg

133 KB
Loading

0 commit comments

Comments
 (0)