Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
qyu21490 opened this issue Jul 21, 2022 · 11 comments
Open

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

qyu21490 opened this issue Jul 21, 2022 · 11 comments

Comments

@qyu21490
Copy link

qyu21490 commented Jul 21, 2022

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
Copy link
Owner

@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
Copy link

Much interested in demo script. Thankyou!

@chophilip21
Copy link

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
Copy link

chophilip21 commented Jul 26, 2022

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
Copy link

theoh-io commented Aug 4, 2022

Very interested in the demo script too ! Impressive work

@CarlHuangNuc
Copy link

also look forward demo /inference script too.

@sialeid
Copy link

sialeid commented Sep 5, 2022

@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
Copy link

I am also looking forward to the demo code

@Lidorkarako
Copy link

Any update regarding the demo script?

@zubairahmed-ai
Copy link

@chophilip21 Did you end up solving it?

@MrRabbit2MissCat
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests