JialianW / TraDeS

Track to Detect and Segment: An Online Multi-Object Tracker (CVPR 2021)
MIT License
553 stars 108 forks source link

How to run demo.py in pycharm #11

Closed xiaoweidao closed 3 years ago

xiaoweidao commented 3 years ago

I am a python novice, sorry to disturb everyone, as the question shows, how to run the following program in pycharm, I can only run successfully in cmdpython demo.py tracking,ddd --load_model ../models/nuScenes_3Dtracking.pth --dataset nuscenes --pre_hm --track_thresh 0.1 --demo ../videos/nuscenes_mini.mp4 --test_focal_length 633

Hayoung93 commented 3 years ago

I don't know if this is the wisest way to run a script via editors, I set parser default values and make the target function run inside of if __name__ == "__main__":

xiaoweidao commented 3 years ago

I don't know if this is the wisest way to run a script via editors, I set parser default values and make the target function run inside of if __name__ == "__main__":

Sorry, I’m not quite sure what you mean, can you explain it in detail?

Hayoung93 commented 3 years ago

I don't know if this is the wisest way to run a script via editors, I set parser default values and make the target function run inside of if __name__ == "__main__":

Sorry, I’m not quite sure what you mean, can you explain it in detail?

You can set default values for parser, for example:

import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--aaa', default=bbb)

Which makes no need to give additional values for it, therefore, you can run the script using PyCharm.

Hope this could help you, but again, it might not be the best way to do it.

xiaoweidao commented 3 years ago

I don't know if this is the wisest way to run a script via editors, I set parser default values and make the target function run inside of if __name__ == "__main__":

Sorry, I’m not quite sure what you mean, can you explain it in detail?

You can set default values for parser, for example:

import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--aaa', default=bbb)

Which makes no need to give additional values for it, therefore, you can run the script using PyCharm.

Hope this could help you, but again, it might not be the best way to do it.

Ok thanks for your help

Hayoung93 commented 3 years ago

@xiaoweidao , I found a proper way to do it. Please read this.

xiaoweidao commented 3 years ago

@xiaoweidao , I found a proper way to do it. Please read this. Thank you very much, through your method I successfully run demo.py in pycharm。 Recently, I also tried to modify the parameters in the opts.py file to run the program in pycharm, but it has not been successful. The demo.py tracking,ddd in demo.py tracking,ddd --load_model ../models/nuScenes_3Dtracking.pth --dataset nuscenes --pre_hm --track_thresh 0.1 --demo ../videos/nuscenes_mini.mp4 --test_focal_length 633 I don't know where to modify opts.py, so it hasn't run successfully.Thank you again for your help, I learned a lot from it.

Hayoung93 commented 3 years ago

tracking,d

You're welcome. I'm also a freshman in the field.

Maybe someone could help if you open a new issue with your problem.

xiaoweidao commented 3 years ago

tracking,d

You're welcome. I'm also a freshman in the field.

Maybe someone could help if you open a new issue with your problem.

ok,thank you again!