MasterBin-IIAU / Unicorn

[ECCV'22 Oral] Towards Grand Unification of Object Tracking
MIT License
953 stars 87 forks source link

Is there any demo for inference video or images? #10

Open qyu21490 opened 2 years ago

qyu21490 commented 2 years ago

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?

MasterBin-IIAU commented 2 years ago

@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.

trathpai commented 2 years ago

Much interested in demo script. Thankyou!

chophilip21 commented 2 years ago

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 commented 2 years ago

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'
theoh-io commented 2 years ago

Very interested in the demo script too ! Impressive work

CarlHuangNuc commented 2 years ago

also look forward demo /inference script too.

sialeid commented 2 years ago

@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?

wumeideqianbi commented 1 year ago

I am also looking forward to the demo code

Lidorkarako commented 1 year ago

Any update regarding the demo script?

zubairahmed-ai commented 1 year ago

@chophilip21 Did you end up solving it?

MrRabbit2MissCat commented 7 months ago

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