예제 #1
0
def exp_gen_and_label_hoi_cand():
    args = parser.parse_args()
    not_specified_args = manage_required_args(
        args,
        parser,
        required_args=['subset'],
        optional_args=['gen_hoi_cand', 'label_hoi_cand'])
    if len(not_specified_args) > 0:
        return

    exp_name = 'hoi_candidates'
    exp_const = ExpConstants(exp_name=exp_name)
    exp_const.subset = args.subset

    data_const = HicoConstants()
    data_const.selected_dets_hdf5 = os.path.join(
        os.getcwd(),
        'data_symlinks/hico_exp/select_confident_boxes_in_hico/' + \
        'selected_coco_cls_dets.hdf5')

    if args.gen_hoi_cand:
        print('Generating HOI candidates from Faster-RCNN dets...')
        hoi_candidates.generate(exp_const, data_const)

    if args.label_hoi_cand:
        print('Labelling HOI candidates from Faster-RCNN dets...')
        data_const.hoi_cand_hdf5 = os.path.join(
            exp_const.exp_dir, f'hoi_candidates_{exp_const.subset}.hdf5')
        label_hoi_candidates.assign(exp_const, data_const)
예제 #2
0
def exp_gen_and_label_hoi_cand_hico():
    exp_name = 'hoi_candidates'
    exp_const = ExpConstants(exp_name=exp_name)
    data_const = HicoConstants()
    data_const.selected_dets_hdf5 = os.path.join(
        os.getcwd(),
        'data_symlinks/hico_exp/select_confident_boxes_in_hico/' + \
        'selected_coco_cls_dets.hdf5')
    _exp_gen_and_label_hoi_cand(exp_const, data_const, 'hico')