xingyizhou / CenterTrack

Simultaneous object detection and tracking using center points.
MIT License
2.39k stars 526 forks source link

ipykernel_launcher.py: error: unrecognized arguments: -f #140

Open Aleja84 opened 4 years ago

Aleja84 commented 4 years ago

Hi, when I try this code: import sys CENTERTRACK_PATH = "/content/CenterTrack/src/lib/" sys.path.insert(0, CENTERTRACK_PATH) from detector import Detector from opts import opts MODEL_PATH = "/content/coco_tracking.pth" TASK = 'tracking' # or 'tracking,multi_pose' for pose tracking and 'tracking,ddd' for monocular 3d tracking import sys opt = opts().init('{} --load_model {}'.format(TASK, MODEL_PATH).split(' ')) detector = Detector(opt) import cv2 img = cv2.imread("/content/imagen_0244.png")

images = ['''image read from open cv or from a video''']

for img in images:

ret = detector.run(img)

I have this error: usage: ipykernel_launcher.py [-h] [--dataset DATASET] [--test_dataset TEST_DATASET] [--exp_id EXP_ID] [--test] [--debug DEBUG] [--no_pause] [--demo DEMO] [--load_model LOAD_MODEL] [--resume] [--gpus GPUS] [--num_workers NUM_WORKERS] [--not_cuda_benchmark] [--seed SEED] [--not_set_cuda_env] [--print_iter PRINT_ITER] [--save_all] [--vis_thresh VIS_THRESH] [--debugger_theme {white,black}] [--eval_val] [--save_imgs SAVE_IMGS] [--save_img_suffix SAVE_IMG_SUFFIX] [--skip_first SKIP_FIRST] [--save_video] [--save_framerate SAVE_FRAMERATE] [--resize_video] [--video_h VIDEO_H] [--video_w VIDEO_W] [--transpose_video] [--show_track_color] [--not_show_bbox] [--not_show_number] [--not_show_txt] [--qualitative] [--tango_color] [--only_show_dots] [--show_trace] [--arch ARCH] [--dla_node DLA_NODE] [--head_conv HEAD_CONV] [--num_head_conv NUM_HEAD_CONV] [--head_kernel HEAD_KERNEL] [--down_ratio DOWN_RATIO] [--not_idaup] [--num_classes NUM_CLASSES] [--num_layers NUM_LAYERS] [--backbone BACKBONE] [--neck NECK] [--msra_outchannel MSRA_OUTCHANNEL] [--efficient_level EFFICIENT_LEVEL] [--prior_bias PRIOR_BIAS] [--input_res INPUT_RES] [--input_h INPUT_H] [--input_w INPUT_W] [--dataset_version DATASET_VERSION] [--optim OPTIM] [--lr LR] [--lr_step LR_STEP] [--save_point SAVE_POINT] [--num_epochs NUM_EPOCHS] [--batch_size BATCH_SIZE] [--master_batch_size MASTER_BATCH_SIZE] [--num_iters NUM_ITERS] [--val_intervals VAL_INTERVALS] [--trainval] [--ltrb] [--ltrb_weight LTRB_WEIGHT] [--reset_hm] [--reuse_hm] [--use_kpt_center] [--add_05] [--dense_reg DENSE_REG] [--flip_test] [--test_scales TEST_SCALES] [--nms] [--K K] [--not_prefetch_test] [--fix_short FIX_SHORT] [--keep_res] [--map_argoverse_id] [--out_thresh OUT_THRESH] [--depth_scale DEPTH_SCALE] [--save_results] [--load_results LOAD_RESULTS] [--use_loaded_results] [--ignore_loaded_cats IGNORE_LOADED_CATS] [--model_output_list] [--non_block_test] [--vis_gt_bev VIS_GT_BEV] [--kitti_split KITTI_SPLIT] [--test_focal_length TEST_FOCAL_LENGTH] [--not_rand_crop] [--not_max_crop] [--shift SHIFT] [--scale SCALE] [--aug_rot AUG_ROT] [--rotate ROTATE] [--flip FLIP] [--no_color_aug] [--tracking] [--pre_hm] [--same_aug_pre] [--zero_pre_hm] [--hm_disturb HM_DISTURB] [--lost_disturb LOST_DISTURB] [--fp_disturb FP_DISTURB] [--pre_thresh PRE_THRESH] [--track_thresh TRACK_THRESH] [--new_thresh NEW_THRESH] [--max_frame_dist MAX_FRAME_DIST] [--ltrb_amodal] [--ltrb_amodal_weight LTRB_AMODAL_WEIGHT] [--public_det] [--no_pre_img] [--zero_tracking] [--hungarian] [--max_age MAX_AGE] [--tracking_weight TRACKING_WEIGHT] [--reg_loss REG_LOSS] [--hm_weight HM_WEIGHT] [--off_weight OFF_WEIGHT] [--wh_weight WH_WEIGHT] [--hp_weight HP_WEIGHT] [--hm_hp_weight HM_HP_WEIGHT] [--amodel_offset_weight AMODEL_OFFSET_WEIGHT] [--dep_weight DEP_WEIGHT] [--dim_weight DIM_WEIGHT] [--rot_weight ROT_WEIGHT] [--nuscenes_att] [--nuscenes_att_weight NUSCENES_ATT_WEIGHT] [--velocity] [--velocity_weight VELOCITY_WEIGHT] [--custom_dataset_img_path CUSTOM_DATASET_IMG_PATH] [--custom_dataset_ann_path CUSTOM_DATASET_ANN_PATH] task ipykernel_launcher.py: error: unrecognized arguments: -f An exception has occurred, use %tb to see the full traceback.

SystemExit: 2

How can I solve this error?

pepeaze commented 2 years ago

Change line 397 of src/lib/opts.py from: opt = self.parse()

to:

opt = self.parse(args)