bearyi26 / DCPT

[ICRA2024] Darkness Clue-Prompted Tracking in Nighttime UAVs
MIT License
15 stars 1 forks source link

How to use video_demo.py #2

Open 462178412 opened 5 months ago

462178412 commented 5 months ago

1.python tracking/create_default_local_file.py --workspace_dir . --data_dir ./data --save_dir ./output 2.in video_demo.py: adding defaults of tracker_name tracker_param tracker_param def main(): parser = argparse.ArgumentParser(description='Run the tracker on your webcam.') parser.add_argument('--tracker_name', type=str, default='DCPT', help='Name of tracking method.') parser.add_argument('--tracker_param', type=str, default='DCPT_Gate', help='Name of parameter file.') parser.add_argument('--videofile', type=str,default='D:\code\Python\DCPT-main\MOT17.mp4', help='path to a video file.') parser.add_argument('--optional_box', type=float, default=None, nargs="+", help='optional_box with format x y w h.') parser.add_argument('--debug', type=int, default=0, help='Debug level.') parser.add_argument('--save_results', dest='save_results', action='store_true', help='Save bounding boxes') parser.set_defaults(save_results=False)

args = parser.parse_args()

run_video(args.tracker_name, args.tracker_param, args.videofile, args.optional_box, args.debug, args.save_results)

3.The weights are put in "D:\code\Python\DCPT\output\checkpoints\train\DCPT\DCPT_Gate\DCPT_ep0045.pth.tar"

4.errors happend: Traceback (most recent call last): File "D:\code\Python\DCPT\tracking..\lib\test\evaluation\environment.py", line 116, in env_settings env_module = importlib.import_module(env_module_name) File "C:\Users\Shijie Wang.conda\envs\DCPT\lib\importlib__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1014, in _gcd_import File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "", line 839, in exec_module File "", line 976, in get_code File "", line 906, in source_to_code File "", line 219, in _call_with_frames_removed File "D:\code\Python\DCPT\tracking..\lib\test\evaluation\local.py", line 30 settings.uav_path = 'D:\code\Python\DCPT\data\uav' ^ SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 24-26: truncated \uXXXX escape

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\code\Python\DCPT\tracking\video_demo.py", line 39, in main() File "D:\code\Python\DCPT\tracking\video_demo.py", line 35, in main run_video(args.tracker_name, args.tracker_param, args.videofile, args.optional_box, args.debug, args.save_results) File "D:\code\Python\DCPT\tracking\video_demo.py", line 19, in run_video tracker = Tracker(tracker_name, tracker_param, "video") File "D:\code\Python\DCPT\tracking..\lib\test\evaluation\tracker.py", line 46, in init env = env_settings() File "D:\code\Python\DCPT\tracking..\lib\test\evaluation\environment.py", line 123, in env_settings raise RuntimeError('YOU HAVE NOT SETUP YOUR local.py!!!\n Go to "{}" and set all the paths you need. ' RuntimeError: YOU HAVE NOT SETUP YOUR local.py!!! Go to "D:\code\Python\DCPT\tracking..\lib\test\evaluation\local.py" and set all the paths you need. Then try to run again.

Process finished with exit code 1

bearyi26 commented 4 months ago

Hello! Thanks for reaching out. I have already checked codes of video_demo and it can work properly. It seems that you have not completed the following step: python tracking/create_default_local_file.py --workspace_dir . --data_dir ./data --save_dir ./output. I believe after running this line of code, you should be able to run video_demo without any problems.

462178412 commented 4 months ago

Thank you! The code can successfully work now,thanks for your reply!!!

汪师杰 @.***

 

------------------ 原始邮件 ------------------ 发件人: "bearyi26/DCPT" @.>; 发送时间: 2024年2月7日(星期三) 下午2:47 @.>; @.**@.>; 主题: Re: [bearyi26/DCPT] How to use video_demo.py (Issue #2)

Hello! Thanks for reaching out. I have already checked codes of video_demo and it can work properly. It seems that you have not completed the following step: python tracking/create_default_local_file.py --workspace_dir . --data_dir ./data --save_dir ./output. I believe after running this line of code, you should be able to run video_demo without any problems.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>