logo
Browse Source

Update

Signed-off-by: Jael Gu <mengjia.gu@zilliz.com>
main
Jael Gu 2 years ago
parent
commit
2f079cbf2c
  1. 37
      README.md
  2. 6
      requirements.txt
  3. BIN
      result.png
  4. BIN
      result1.png
  5. BIN
      result2.png

37
README.md

@ -19,37 +19,22 @@ and maps vectors with labels.
Use the pretrained TimeSformer model ('timesformer_k400_8x224') Use the pretrained TimeSformer model ('timesformer_k400_8x224')
to classify and generate a vector for the given video path './archery.mp4' ([download](https://dl.fbaipublicfiles.com/pytorchvideo/projects/archery.mp4)). to classify and generate a vector for the given video path './archery.mp4' ([download](https://dl.fbaipublicfiles.com/pytorchvideo/projects/archery.mp4)).
*Write the pipeline in simplified style*:
*Write a pipeline with explicit inputs/outputs name specifications:*
```python ```python
import towhee
(
towhee.glob('./archery.mp4')
.video_decode.ffmpeg()
.action_classification.timesformer(model_name='timesformer_k400_8x224')
.show()
from towhee.dc2 import pipe, ops, DataCollection
p = (
pipe.input('path')
.map('path', 'frames', ops.video_decode.ffmpeg())
.map('frames', ('labels', 'scores', 'features'),
ops.action_classification.timesformer(model_name='timesformer_k400_8x224'))
.output('path', 'labels', 'scores', 'features')
) )
```
<img src="./result1.png" width="800px"/>
<br />
*Write a same pipeline with explicit inputs/outputs name specifications:*
```python
import towhee
(
towhee.glob['path']('./archery.mp4')
.video_decode.ffmpeg['path', 'frames']()
.action_classification.timesformer['frames', ('labels', 'scores', 'features')](
model_name='timesformer_k400_8x224')
.select['path', 'labels', 'scores', 'features']()
.show(formatter={'path': 'video_path'})
)
DataCollection(p('./archery.mp4')).show()
``` ```
<img src="./result2.png" width="800px"/>
<img src="./result.png" width="800px"/>
<br /> <br />

6
requirements.txt

@ -1,6 +1,6 @@
towhee.models>=0.7.0
towhee>=0.7.0
# towhee.models>=0.7.0
# towhee>=0.7.0
einops
scipy scipy
torchvision torchvision
torch torch

BIN
result.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
result1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

BIN
result2.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

Loading…
Cancel
Save