FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Update docs video_inference_superanimal() (#2848) · DeepLabCut/DeepLabCut@ea64eee · GitHub

Commit ea64eee

Browse files
authored
Update docs video_inference_superanimal() (#2848)
1 parent db23d67 commit ea64eee

2 files changed

Lines changed: 24 additions & 12 deletions

File tree

‎deeplabcut/modelzoo/video_inference.py‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -242,19 +242,22 @@ def video_inference_superanimal(
242242
not require too much training. However, you can make them higher if you see a
243243
substaintial gain in the training logs.
244244
245-
Examples (TensorFlow Engine)
245+
Examples
246246
--------
247247
248-
>>> import deeplabcut.modelzoo.video_inference.video_inference_superanimal as video_inference_superanimal
249-
>>> superanimal_name = 'superanimal_topviewmouse_dlcrnet'
250-
>>> videotype = 'mp4'
248+
>>> from deeplabcut.modelzoo.video_inference import video_inference_superanimal
249+
>>> videos = ["/path/to/my/video.mp4"]
250+
>>> superanimal_name = "superanimal_topviewmouse"
251+
>>> videotype = "mp4"
251252
>>> scale_list = [200, 300, 400]
252253
>>> video_inference_superanimal(
253-
video,
254-
video_adapt = True,
254+
videos,
255255
superanimal_name,
256-
videotype = '.avi',
256+
model_name="hrnet_w32",
257+
detector_name="fasterrcnn_resnet50_fpn_v2",
257258
scale_list = scale_list,
259+
videotype = videotype,
260+
video_adapt = True,
258261
)
259262
260263
Tips:

‎docs/ModelZoo.md‎

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,14 @@ You can simply call the model and run video inference.
7575
To note, a good step is typically to use our self-supervised video adaptation method to reduce jitter. In the `deeplabcut.video_inference_superanimal` simply function set the `video_adapt` option to __True__. Be aware, that enabling this option will (minimally) extend the processing time.
7676

7777
```python
78-
video_path = 'demo-video.mp4'
79-
superanimal_name = 'superanimal_quadruped_hrnetw32'
78+
import deeplabcut
79+
video_path = "demo-video.mp4"
80+
superanimal_name = "superanimal_quadruped"
8081

8182
deeplabcut.video_inference_superanimal([video_path],
8283
superanimal_name,
84+
model_name="hrnet_w32",
85+
detector_name="fasterrcnn_resnet50_fpn_v2",
8386
video_adapt = False)
8487
```
8588

@@ -89,13 +92,19 @@ deeplabcut.video_inference_superanimal([video_path],
8992
In our work we introduced a spatial-pyramid for smartly rescaling images. Imagine if you frames are much larger than what we trained on, it would be hard for the model to find the animal! Here, you can simply guide the model with the `scale_list`:
9093

9194
```python
92-
video_path = 'demo-video.mp4'
93-
superanimal_name = 'superanimal_quadruped_dlcrnet'
95+
import deeplabcut
96+
video_path = "demo-video.mp4"
97+
superanimal_name = "superanimal_quadruped"
9498

9599
# The purpose of the scale list is to aggregate predictions from various image sizes. We anticipate the appearance size of the animal in the images to be approximately 400 pixels.
96100
scale_list = range(200, 600, 50)
97101

98-
deeplabcut.video_inference_superanimal([video_path], superanimal_name, scale_list=scale_list, video_adapt = False)
102+
deeplabcut.video_inference_superanimal([video_path],
103+
superanimal_name,
104+
model_name="hrnet_w32",
105+
detector_name="fasterrcnn_resnet50_fpn_v2",
106+
scale_list=scale_list,
107+
video_adapt = False)
99108
```
100109

101110
#### Practical example: Using transfer learning with superanimal weights.

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL