Comments (4)
Hi,
When using pose_hrnet_w32_256x192.pth
, you have to change the number of channels from 48
(default) to 32
and the image resolution from 384x288
to 256x192
(options -c
and -r
).
Please check the documentation of the script live-demo.py
with the command python scripts/live-demo.py --help
or the documentation of the class SimpleHRNet
for further details.
Yes, you can switch to yolo-tiny weights passing their paths through the parameters of the SimpleHRNet class. If you're using the live-demo.py
script, you can replace lines 46 to 56 with:
model = SimpleHRNet(
hrnet_c,
hrnet_j,
hrnet_weights,
model_name=hrnet_m,
resolution=image_resolution,
multiperson=not single_person,
return_bounding_boxes=not disable_tracking,
max_batch_size=max_batch_size,
yolo_model_def="./models/detectors/yolo/config/yolov3-tiny.cfg",
yolo_weights_path="./models/detectors/yolo/weights/yolov3-tiny.weights",
device=device
)
It's hard to guess the difference in inference time between these settings, the best option is to try them.
Please post your inference time with pose_hrnet_w32_256x192.pth
and with yolov3-tiny
! I'll post mine soon.
from simple-hrnet.
Thank you!
I am timing only the predict call, like this:
start = time.time()
pts = model.predict(frame)
end = time.time()
print(end-start)
Running on the same image in a loop 10 times with the pose_hrnet_w48_384x288
weights, I get inference times of (seconds):
0.23575758934020996
0.2087860107421875
0.19779682159423828
0.20479035377502441
0.20778775215148926
0.20179319381713867
0.1938016414642334
0.20778727531433105
0.18680858612060547
0.19979572296142578
Switching to the pose_hrnet_w32_256x192
weights and running the same thing, I see a worse result when I draw the keypoints, and the times are much the same:
0.21777725219726562
0.1957993507385254
0.21677803993225098
0.19879746437072754
0.19679784774780273
0.2067883014678955
0.18481040000915527
0.1957998275756836
0.19080471992492676
0.19679927825927734
I have not tested yolo-tiny yet, as I wanted to try one at a time and log the results.
Do you see the same thing?
Thanks!
from simple-hrnet.
Hello @antithing , sorry for the late reply.
Yes, I've experienced a similar behaviour when running in single-person mode while I've experienced different timings when running in multi-person mode.
Here's the inference time on a GTX 1060 as mean and standard deviation over 10 predictions:
pose_hrnet_w48_384x288
- Single-person:
0.160240 ± 0.004197
- Multi-person, frame without people:
0.049684 ± 0.000645
(this is just the forward pass of YOLOv3) - Multi-person, frame with 1 person:
0.216628 ± 0.008854
- Multi-person, frame with many people (~8):
0.483446 ± 0.032138
pose_hrnet_w32_256x192
- Single-person:
0.158238 ± 0.003195
- Multi-person, frame without people:
0.049384 ± 0.000488
(this is just the forward pass of YOLOv3) - Multi-person, frame with 1 person:
0.211480 ± 0.008367
- Multi-person, frame with many people (~8):
0.242922 ± 0.004263
As you can see, in single-person mode, the difference between the two architecture is minimal while in multi-person mode the difference is considerable when many people are in the scene.
This difference could be mainly caused by the pre-processing steps (which include the resize operations).
Regarding YOLO, the inference time of YOLOv3 is 0.049684 ± 0.000645
.
The one of YOLOv3-tiny is 0.015586 ± 0.000668
.
I think you could expect a similar detection speedup (~3x
) on your hardware configuration too.
In less powerful hardware such as my laptop, the overall fps of live_demo.py
are ~5fps
with YOLOv3 and ~9fps
with YOLOv3-tiny.
Btw, I've just added a new option --use_tiny_yolo
in the scripts live-demo.py
and extract-keypoints.py
! Please check out the latest commit.
from simple-hrnet.
Thank you! I will grab the new commit. Much appreciated.
from simple-hrnet.
Related Issues (20)
- TypeError: __init__() takes 2 positional arguments but 3 were given HOT 2
- 有剪枝,蒸馏方面的计划吗? HOT 1
- RuntimeError: Error(s) in loading state_dict for HRNet: HOT 1
- Evaluate custom dataset HOT 4
- Get inference time HOT 1
- Use YOLOv5 as a detector HOT 2
- Turn off some keypoints
- Data augmentations of training
- How to solce Error: ffprobe error (see stderr output for detail) HOT 2
- Integrating with poseflow HOT 1
- RuntimeError: The size of tensor a (645) must match the size of tensor b (646) at non-singleton dimension 2 HOT 3
- FileNotFoundError: [WinError 2] The system cannot find the specified file HOT 7
- How to Train with 1 Class??
- [Request] Making a python file to get AP/AR for each class? HOT 1
- ImportError: cannot import name 'FFProbe' HOT 3
- Using a different detector HOT 1
- how to output the result in coco json file and retrain a new model HOT 2
- PermissionError: [Errno 13] Permission denied: / FileNotFoundError: [WinError 2] HOT 1
- Broken model file pose_hrnet_w48_384x288.pth HOT 1
- ffmpeg._run.Error: ffprobe error (see stderr output for detail) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simple-hrnet.