|
a |
|
b/landmark_extraction/README.md |
|
|
1 |
# To use the yolov7-pose-estimation |
|
|
2 |
|
|
|
3 |
### Steps to run Code |
|
|
4 |
- If you are using google colab then you will first need to mount the drive with mentioned command first, <b>(Windows or Linux users)</b> both can skip this step. |
|
|
5 |
``` |
|
|
6 |
from google.colab import drive |
|
|
7 |
drive.mount("/content/drive") |
|
|
8 |
``` |
|
|
9 |
- Clone the repository. |
|
|
10 |
``` |
|
|
11 |
git clone https://github.com/RizwanMunawar/yolov7-pose-estimation.git |
|
|
12 |
``` |
|
|
13 |
|
|
|
14 |
- Goto the cloned folder. |
|
|
15 |
``` |
|
|
16 |
cd yolov7-pose-estimation |
|
|
17 |
``` |
|
|
18 |
|
|
|
19 |
- Create a virtual envirnoment (Recommended, If you dont want to disturb python packages) |
|
|
20 |
``` |
|
|
21 |
### For Linux Users |
|
|
22 |
python3 -m venv psestenv |
|
|
23 |
source psestenv/bin/activate |
|
|
24 |
|
|
|
25 |
### For Window Users |
|
|
26 |
python3 -m venv psestenv |
|
|
27 |
cd psestenv |
|
|
28 |
cd Scripts |
|
|
29 |
activate |
|
|
30 |
cd .. |
|
|
31 |
cd .. |
|
|
32 |
``` |
|
|
33 |
|
|
|
34 |
- Upgrade pip with mentioned command below. |
|
|
35 |
``` |
|
|
36 |
pip install --upgrade pip |
|
|
37 |
``` |
|
|
38 |
|
|
|
39 |
- Install requirements with mentioned command below. |
|
|
40 |
|
|
|
41 |
``` |
|
|
42 |
pip install -r requirements.txt |
|
|
43 |
``` |
|
|
44 |
|
|
|
45 |
- Download yolov7 pose estimation weights from [link](https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-w6-pose.pt) and move them to the working directory {yolov7-pose-estimation} |
|
|
46 |
|
|
|
47 |
|
|
|
48 |
- To run yolov7 standalone |
|
|
49 |
``` |
|
|
50 |
python pose-estimate.py |
|
|
51 |
|
|
|
52 |
#if you want to change source file |
|
|
53 |
python pose-estimate.py --source "your custom video.mp4" |
|
|
54 |
|
|
|
55 |
#For CPU |
|
|
56 |
python pose-estimate.py --source "your custom video.mp4" --device cpu |
|
|
57 |
|
|
|
58 |
#For GPU |
|
|
59 |
python pose-estimate.py --source "your custom video.mp4" --device 0 |
|
|
60 |
|
|
|
61 |
#For View-Image |
|
|
62 |
python pose-estimate.py --source "your custom video.mp4" --device 0 --view-img |
|
|
63 |
|
|
|
64 |
#For LiveStream (Ip Stream URL Format i.e "rtsp://username:pass@ipaddress:portno/video/video.amp") |
|
|
65 |
python pose-estimate.py --source "your IP Camera Stream URL" --device 0 --view-img |
|
|
66 |
|
|
|
67 |
#For WebCam |
|
|
68 |
python pose-estimate.py --source 0 --view-img |
|
|
69 |
|
|
|
70 |
#For External Camera |
|
|
71 |
python pose-estimate.py --source 1 --view-img |
|
|
72 |
``` |
|
|
73 |
|
|
|
74 |
- Output file will be created in the working directory with name <b>["your-file-name-without-extension"+"_keypoint.mp4"]</b> |
|
|
75 |
|
|
|
76 |
#### RESULTS |
|
|
77 |
|
|
|
78 |
<table> |
|
|
79 |
<tr> |
|
|
80 |
<td>Football Match Pose-Estimation</td> |
|
|
81 |
<td>Cricket Match Pose-Estimation</td> |
|
|
82 |
<td>FPS and Time Comparision</td> |
|
|
83 |
<td>Live Stream Pose-Estimation</td> |
|
|
84 |
</tr> |
|
|
85 |
<tr> |
|
|
86 |
<td><img src="https://user-images.githubusercontent.com/62513924/185089411-3f9ae391-ec23-4ca2-aba0-abf3c9991050.png" width=640 height=180></td> |
|
|
87 |
<td><img src="https://user-images.githubusercontent.com/62513924/185228806-4ba62e7a-12ef-4965-a44a-6b5ba9a3bf28.png" width=640 height=180></td> |
|
|
88 |
<td><img src="https://user-images.githubusercontent.com/62513924/185324844-20ce3d48-f5f5-4a17-8b62-9b51ab02a716.png" width=640 height=180></td> |
|
|
89 |
<td><img src="https://user-images.githubusercontent.com/62513924/185587159-6643529c-7840-48d6-ae1d-2d7c27d417ab.png" width=640 height =180></td> |
|
|
90 |
</tr> |
|
|
91 |
</table> |
|
|
92 |
|
|
|
93 |
#### References |
|
|
94 |
- https://github.com/WongKinYiu/yolov7 |
|
|
95 |
- https://github.com/augmentedstartups/yolov7 |
|
|
96 |
- https://github.com/augmentedstartups |
|
|
97 |
- https://learnopencv.com/yolov7-object-detection-paper-explanation-and-inference/ |
|
|
98 |
- https://github.com/ultralytics/yolov5 |