|
@ -1,4 +1,4 @@ |
|
|
# Video Classification with Pytorchvideo |
|
|
|
|
|
|
|
|
# Action Classification with Pytorchvideo |
|
|
|
|
|
|
|
|
*Author: [Jael Gu](https://github.com/jaelgu)* |
|
|
*Author: [Jael Gu](https://github.com/jaelgu)* |
|
|
|
|
|
|
|
@ -6,7 +6,7 @@ |
|
|
|
|
|
|
|
|
## Description |
|
|
## Description |
|
|
|
|
|
|
|
|
A video classification operator is able to predict labels (and corresponding scores) |
|
|
|
|
|
|
|
|
An action classification operator is able to predict labels of human activities (with corresponding scores) |
|
|
and extracts features given the input video. |
|
|
and extracts features given the input video. |
|
|
It preprocesses video frames with video transforms and then loads pre-trained models by model names. |
|
|
It preprocesses video frames with video transforms and then loads pre-trained models by model names. |
|
|
This operator has implemented pre-trained models from [Pytorchvideo](https://github.com/facebookresearch/pytorchvideo) |
|
|
This operator has implemented pre-trained models from [Pytorchvideo](https://github.com/facebookresearch/pytorchvideo) |
|
@ -27,7 +27,7 @@ import towhee |
|
|
( |
|
|
( |
|
|
towhee.glob('./archery.mp4') |
|
|
towhee.glob('./archery.mp4') |
|
|
.video_decode.ffmpeg() |
|
|
.video_decode.ffmpeg() |
|
|
.video_classification.pytorchvideo(model_name='slowfast_r50') |
|
|
|
|
|
|
|
|
.action_classification.pytorchvideo(model_name='slowfast_r50') |
|
|
.show() |
|
|
.show() |
|
|
) |
|
|
) |
|
|
``` |
|
|
``` |
|
@ -41,7 +41,7 @@ import towhee |
|
|
( |
|
|
( |
|
|
towhee.glob['path']('./archery.mp4') |
|
|
towhee.glob['path']('./archery.mp4') |
|
|
.video_decode.ffmpeg['path', 'frames']() |
|
|
.video_decode.ffmpeg['path', 'frames']() |
|
|
.video_classification.pytorchvideo['frames', ('labels', 'scores', 'features')]( |
|
|
|
|
|
|
|
|
.action_classification.pytorchvideo['frames', ('labels', 'scores', 'features')]( |
|
|
model_name='slowfast_r50') |
|
|
model_name='slowfast_r50') |
|
|
.select['labels', 'scores', 'features']() |
|
|
.select['labels', 'scores', 'features']() |
|
|
.show(formatter={'path':'video_path'}) |
|
|
.show(formatter={'path':'video_path'}) |
|
@ -55,7 +55,7 @@ import towhee |
|
|
|
|
|
|
|
|
Create the operator via the following factory method |
|
|
Create the operator via the following factory method |
|
|
|
|
|
|
|
|
***video_classification.pytorchvideo( |
|
|
|
|
|
|
|
|
***action_classification.pytorchvideo( |
|
|
model_name='x3d_xs', skip_preprocess=False, classmap=None, topk=5)*** |
|
|
model_name='x3d_xs', skip_preprocess=False, classmap=None, topk=5)*** |
|
|
|
|
|
|
|
|
**Parameters:** |
|
|
**Parameters:** |
|
|