Skip to content

ITainment-UIT-04/YOLOv7_PoseEstimation

Repository files navigation

[YOLOv7] Pose Estimation

Python 3.9 Anaconda

Setup & Installation (For Anaconda environment)

conda update conda
conda create --name my_env
conda info --env
conda activate my_env

Install CuDNN

conda install -c anaconda cudnn

Install Tensorflow

conda install -c conda-forge tensorflow

Install Pytorch

conda install pytorch==1.12.0 torchvision==0.13.0 torchaudio==0.12.0 cudatoolkit=11.3 -c pytorch

After install Pytorch, command:

python
import torch
torch.cuda.is_available()

Desired results:

True

After that, exit:

exit()

Download file requirements.txt and command

pip install -r requirements.txt

Test Pose estimation with yolov7-w6-pose.pt

python detect.py --weight yolov7-w6-pose.pt --kpt-label --hide-labels --hide-conf --source <path> --line-thickness <int> --nosave --view-img

Usage

detect.py [-h] [--weights WEIGHTS [WEIGHTS ...]] [--source SOURCE] [--img-size IMG_SIZE [IMG_SIZE ...]]
                 [--conf-thres CONF_THRES] [--iou-thres IOU_THRES] [--device DEVICE] [--view-img] [--save-txt]
                 [--save-txt-tidl] [--save-bin] [--save-conf] [--save-crop] [--nosave]
                 [--classes CLASSES [CLASSES ...]] [--agnostic-nms] [--augment] [--update] [--project PROJECT]
                 [--name NAME] [--exist-ok] [--line-thickness LINE_THICKNESS] [--hide-labels] [--hide-conf]
                 [--kpt-label] [--nobbox]

Real Time Pose Estimation

python detect.py --weight yolov7-w6-pose.pt --kpt-label --hide-labels --hide-conf --source 0 --nosave --view-img

Note: You can get YOLOv7 inference code and download difference WEIGHTS

python detect.py --<WEIGHTS> --kpt-label --hide-labels --hide-conf --source <path> --nobbox

Source: Object Detection (YOLOv7, YOLOv3, YOLOv4 , TensorFlow)