Unicorn icon indicating copy to clipboard operation
Unicorn copied to clipboard

Is there any demo for inference video or images?

Open qyu21490 opened this issue 2 years ago • 11 comments

Hi, author. I have read your paper, which is a fascinating piece of work. Is there any code of demo for inference video or images?

qyu21490 avatar Jul 21 '22 12:07 qyu21490

@qyu21490 Hi, we will release a demo script as soon as possible. This script will show how to use Unicorn for inference of four tracking tasks.

MasterBin-IIAU avatar Jul 21 '22 15:07 MasterBin-IIAU

Much interested in demo script. Thankyou!

trathpai avatar Jul 22 '22 09:07 trathpai

would it be something like this?

python3 ./tools/demo.py video --path ./assets/vancouver.mp4 -f ./exps/default/unicorn_inst_convnext_tiny_800x1280.py --ckpt ./weights/unicorn_inst_convnext_tiny_800x1280/latest_ckpt.pth --device gpu --mask_thres 0.3 --save_result

chophilip21 avatar Jul 26 '22 22:07 chophilip21

Tried various different combinations for running demo, but had no luck. Look forward to seeing a demo code.

I have tried:

python3 ./tools/demo.py video --path ./assets/vancouver.mp4 -f ./exps/default/unicorn_track_large_mask.py --ckpt ./weights/unicorn_track_large_mask/latest_ckpt.pth --device gpu --mask_thres 0.3 --save_result

And it seems like it's ignoring my checkpoint argument for loading ckpt. It always tries to load checkpoints from Unicorn_outputs. And following is the error log that I get:

Loading pretrained weights from /home/philip/tracker/Unicorn/datasets/../Unicorn_outputs/unicorn_track_large/latest_ckpt.pth
missing keys: []
unexpected keys: []
2022-07-26 16:10:21.373 | INFO     | __main__:main:307 - loading checkpoint
2022-07-26 16:10:21.918 | INFO     | __main__:main:311 - loaded checkpoint done.
2022-07-26 16:10:22.002 | INFO     | __main__:imageflow_demo:249 - video save_path is ./Unicorn_outputs/unicorn_track_large_mask/vis_res/2022_07_26_16_10_21/vancouver.mp4
/home/philip/anaconda3/envs/tracker/lib/python3.9/site-packages/torch/utils/checkpoint.py:25: UserWarning: None of the inputs have requires_grad=True. Gradients will be None
  warnings.warn("None of the inputs have requires_grad=True. Gradients will be None")
/home/philip/anaconda3/envs/tracker/lib/python3.9/site-packages/torch/nn/functional.py:3631: UserWarning: Default upsampling behavior when mode=bicubic is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details.
  warnings.warn(
/home/philip/anaconda3/envs/tracker/lib/python3.9/site-packages/torch/functional.py:445: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at  /opt/conda/conda-bld/pytorch_1634272204863/work/aten/src/ATen/native/TensorShape.cpp:2157.)
  return _VF.meshgrid(tensors, **kwargs)  # type: ignore[attr-defined]
Traceback (most recent call last):
  File "/home/philip/tracker/Unicorn/./tools/demo.py", line 345, in <module>
    main(exp, args)
  File "/home/philip/tracker/Unicorn/./tools/demo.py", line 338, in main
    imageflow_demo(predictor, vis_folder, current_time, args)
  File "/home/philip/tracker/Unicorn/./tools/demo.py", line 256, in imageflow_demo
    outputs, img_info = predictor.inference(frame)
  File "/home/philip/tracker/Unicorn/./tools/demo.py", line 171, in inference
    outputs = postprocess(
  File "/home/philip/tracker/Unicorn/unicorn/utils/boxes.py", line 34, in postprocess
    box_corner = prediction.new(prediction.shape)
AttributeError: 'tuple' object has no attribute 'new'ent_time, args)
  File "/home/philip/tracker/Unicorn/./tools/demo.py", line 256, in imageflow_demo
    outputs, img_info = predictor.inference(frame)
  File "/home/philip/tracker/Unicorn/./tools/demo.py", line 171, in inference
    outputs = postprocess(
  File "/home/philip/tracker/Unicorn/unicorn/utils/boxes.py", line 34, in postprocess
    box_corner = prediction.new(prediction.shape)
AttributeError: 'tuple' object has no attribute 'new'

chophilip21 avatar Jul 26 '22 23:07 chophilip21

Very interested in the demo script too ! Impressive work

theoh-io avatar Aug 04 '22 09:08 theoh-io

also look forward demo /inference script too.

CarlHuangNuc avatar Aug 22 '22 22:08 CarlHuangNuc

@qyu21490 Hi, we will release a demo script as soon as possible. This script will show how to use Unicorn for inference of four tracking tasks.

Dear.Bin I am very interested in the demo script. May I ask if the script will be released this week?

sialeid avatar Sep 05 '22 10:09 sialeid

I am also looking forward to the demo code

wumeideqianbi avatar Sep 14 '22 02:09 wumeideqianbi

Any update regarding the demo script?

Lidorkarako avatar Apr 10 '23 08:04 Lidorkarako

@chophilip21 Did you end up solving it?

zubairahmed-ai avatar Apr 10 '23 15:04 zubairahmed-ai

Tried various different combinations for running demo, but had no luck. Look forward to seeing a demo code.

I have tried:

python3 ./tools/demo.py video --path ./assets/vancouver.mp4 -f ./exps/default/unicorn_track_large_mask.py --ckpt ./weights/unicorn_track_large_mask/latest_ckpt.pth --device gpu --mask_thres 0.3 --save_result

And it seems like it's ignoring my checkpoint argument for loading ckpt. It always tries to load checkpoints from Unicorn_outputs. And following is the error log that I get:

Loading pretrained weights from /home/philip/tracker/Unicorn/datasets/../Unicorn_outputs/unicorn_track_large/latest_ckpt.pth
missing keys: []
unexpected keys: []
2022-07-26 16:10:21.373 | INFO     | __main__:main:307 - loading checkpoint
2022-07-26 16:10:21.918 | INFO     | __main__:main:311 - loaded checkpoint done.
2022-07-26 16:10:22.002 | INFO     | __main__:imageflow_demo:249 - video save_path is ./Unicorn_outputs/unicorn_track_large_mask/vis_res/2022_07_26_16_10_21/vancouver.mp4
/home/philip/anaconda3/envs/tracker/lib/python3.9/site-packages/torch/utils/checkpoint.py:25: UserWarning: None of the inputs have requires_grad=True. Gradients will be None
  warnings.warn("None of the inputs have requires_grad=True. Gradients will be None")
/home/philip/anaconda3/envs/tracker/lib/python3.9/site-packages/torch/nn/functional.py:3631: UserWarning: Default upsampling behavior when mode=bicubic is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details.
  warnings.warn(
/home/philip/anaconda3/envs/tracker/lib/python3.9/site-packages/torch/functional.py:445: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at  /opt/conda/conda-bld/pytorch_1634272204863/work/aten/src/ATen/native/TensorShape.cpp:2157.)
  return _VF.meshgrid(tensors, **kwargs)  # type: ignore[attr-defined]
Traceback (most recent call last):
  File "/home/philip/tracker/Unicorn/./tools/demo.py", line 345, in <module>
    main(exp, args)
  File "/home/philip/tracker/Unicorn/./tools/demo.py", line 338, in main
    imageflow_demo(predictor, vis_folder, current_time, args)
  File "/home/philip/tracker/Unicorn/./tools/demo.py", line 256, in imageflow_demo
    outputs, img_info = predictor.inference(frame)
  File "/home/philip/tracker/Unicorn/./tools/demo.py", line 171, in inference
    outputs = postprocess(
  File "/home/philip/tracker/Unicorn/unicorn/utils/boxes.py", line 34, in postprocess
    box_corner = prediction.new(prediction.shape)
AttributeError: 'tuple' object has no attribute 'new'ent_time, args)
  File "/home/philip/tracker/Unicorn/./tools/demo.py", line 256, in imageflow_demo
    outputs, img_info = predictor.inference(frame)
  File "/home/philip/tracker/Unicorn/./tools/demo.py", line 171, in inference
    outputs = postprocess(
  File "/home/philip/tracker/Unicorn/unicorn/utils/boxes.py", line 34, in postprocess
    box_corner = prediction.new(prediction.shape)
AttributeError: 'tuple' object has no attribute 'new'

How can this problem be solved

MrRabbit2MissCat avatar Jan 15 '24 08:01 MrRabbit2MissCat