# movenet **Repository Path**: giteebob/movenet ## Basic Information - **Project Name**: movenet - **Description**: Un-official implementation of MoveNet from Google - **Primary Language**: Python - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-01-26 - **Last Updated**: 2022-01-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## Lee-man's python implementation of movenet. # MoveNet Unofficial implementation of [MoveNet](https://blog.tensorflow.org/2021/05/next-generation-pose-detection-with-movenet-and-tensorflowjs.html) from Google. This repo is heavily borrowed from [CenterNet](https://github.com/xingyizhou/CenterNet) and [TorchVision](https://github.com/pytorch/pytorch). See my another repo [lee-man/movenet-pytorch](https://github.com/lee-man/movenet-pytorch) for inference only. ## Update I remove the redundant code for other dataset and tasks, simplify this codebase, and make it support MoveNet fine-tuning on the customized dataset (named *Active* here). ## Prepare the datasets Move the images and annotations into data and name the folder as `Active`. The annotation format should be COCO format. If you annotate the images with MPII format, you can utilize [convert_active_to_coco.py](src/tools/convert_active_to_coco.py) and [convert_mpii_to_coco.py](src/tools/convert_mpii_to_coco.py). ## Run training code ```bash cd src python main.py single_pose --exp_id yoga_movenet --dataset active --arch movenet --batch_size 24 --lr 5e-4 --gpus 0 --num_epochs 50 --lr_step 30 --num_workers 4 --load_model ../models/movenet.pth ``` ## Run evaluation code ```bash cd src python test.py single_pose --exp_id yoga_movenet --dataset active --arch movenet --resume ``` To directly test the pre-trained Movenet, run: ```bash cd src python test.py single_pose --exp_id movenet --dataset active --arch movenet --load_model ../models/movenet.pth ``` ## Run demo code 1. For the finetuned model, move the checkpoint to directory `models` and run: ```bash cd src python demo.py single_pose --dataset active --arch movenet --demo ../images/active --load_model ../models/{$MODEL} --K 1 --gpus -1 --debug 2 ``` 2. For original MoveNet, run: ```bash cd src python demo.py single_pose --dataset active --arch movenet --demo ../images --load_model ../models/movenet.pth --K 1 --gpus -1 --debug 2 ``` Below is the original README from CenterNet. It's ane excellent work and I realy like it. # Objects as Points Object detection, 3D detection, and pose estimation using center point detection:  > [**Objects as Points**](http://arxiv.org/abs/1904.07850), > Xingyi Zhou, Dequan Wang, Philipp Krähenbühl, > *arXiv technical report ([arXiv 1904.07850](http://arxiv.org/abs/1904.07850))* Contact: [zhouxy@cs.utexas.edu](mailto:zhouxy@cs.utexas.edu). Any questions or discussions are welcomed! ## Updates - (June, 2020) We released a state-of-the-art Lidar-based 3D detection and tracking framework [CenterPoint](https://github.com/tianweiy/CenterPoint). - (April, 2020) We released a state-of-the-art (multi-category-/ pose-/ 3d-) tracking extension [CenterTrack](https://github.com/xingyizhou/CenterTrack). ## Abstract Detection identifies objects as axis-aligned boxes in an image. Most successful object detectors enumerate a nearly exhaustive list of potential object locations and classify each. This is wasteful, inefficient, and requires additional post-processing. In this paper, we take a different approach. We model an object as a single point -- the center point of its bounding box. Our detector uses keypoint estimation to find center points and regresses to all other object properties, such as size, 3D location, orientation, and even pose. Our center point based approach, CenterNet, is end-to-end differentiable, simpler, faster, and more accurate than corresponding bounding box based detectors. CenterNet achieves the best speed-accuracy trade-off on the MS COCO dataset, with 28.1% AP at 142 FPS, 37.4% AP at 52 FPS, and 45.1% AP with multi-scale testing at 1.4 FPS. We use the same approach to estimate 3D bounding box in the KITTI benchmark and human pose on the COCO keypoint dataset. Our method performs competitively with sophisticated multi-stage methods and runs in real-time. ## Highlights - **Simple:** One-sentence method summary: use keypoint detection technic to detect the bounding box center point and regress to all other object properties like bounding box size, 3d information, and pose. - **Versatile:** The same framework works for object detection, 3d bounding box estimation, and multi-person pose estimation with minor modification. - **Fast:** The whole process in a single network feedforward. No NMS post processing is needed. Our DLA-34 model runs at *52* FPS with *37.4* COCO AP. - **Strong**: Our best single model achieves *45.1*AP on COCO test-dev. - **Easy to use:** We provide user friendly testing API and webcam demos. ## Main results ### Object Detection on COCO validation | Backbone | AP / FPS | Flip AP / FPS| Multi-scale AP / FPS | |--------------|-----------|--------------|-----------------------| |Hourglass-104 | 40.3 / 14 | 42.2 / 7.8 | 45.1 / 1.4 | |DLA-34 | 37.4 / 52 | 39.2 / 28 | 41.7 / 4 | |ResNet-101 | 34.6 / 45 | 36.2 / 25 | 39.3 / 4 | |ResNet-18 | 28.1 / 142| 30.0 / 71 | 33.2 / 12 | ### Keypoint detection on COCO validation | Backbone | AP | FPS | |--------------|-----------|--------------| |Hourglass-104 | 64.0 | 6.6 | |DLA-34 | 58.9 | 23 | ### 3D bounding box detection on KITTI validation |Backbone|FPS|AP-E|AP-M|AP-H|AOS-E|AOS-M|AOS-H|BEV-E|BEV-M|BEV-H| |--------|---|----|----|----|-----|-----|-----|-----|-----|-----| |DLA-34 |32 |96.9|87.8|79.2|93.9 |84.3 |75.7 |34.0 |30.5 |26.8 | All models and details are available in our [Model zoo](readme/MODEL_ZOO.md). ## Installation Please refer to [INSTALL.md](readme/INSTALL.md) for installation instructions. ## Use CenterNet We support demo for image/ image folder, video, and webcam. First, download the models (By default, [ctdet_coco_dla_2x](https://drive.google.com/open?id=1pl_-ael8wERdUREEnaIfqOV_VF2bEVRT) for detection and [multi_pose_dla_3x](https://drive.google.com/open?id=1PO1Ax_GDtjiemEmDVD7oPWwqQkUu28PI) for human pose estimation) from the [Model zoo](readme/MODEL_ZOO.md) and put them in `CenterNet_ROOT/models/`. For object detection on images/ video, run: ~~~ python demo.py ctdet --demo /path/to/image/or/folder/or/video --load_model ../models/ctdet_coco_dla_2x.pth ~~~ We provide example images in `CenterNet_ROOT/images/` (from [Detectron](https://github.com/facebookresearch/Detectron/tree/master/demo)). If set up correctly, the output should look like