from networks.HOI import HOI net = HOI(model_name=args.model) with_pose = False # if args.model.__contains__('pose'): # with_pose = True coco = False zero_shot_type = get_zero_shot_type(args.model) large_neg_for_ho = False if args.model.endswith('_aug5_new') or args.model.endswith('_aug6_new'): large_neg_for_ho = True image, image_id, num_pos, Human_augmented, Object_augmented, action_HO, sp = obtain_data( Pos_augment=args.Pos_augment, Neg_select=args.Neg_select, augment_type=augment_type, with_pose=with_pose, zero_shot_type=zero_shot_type, ) print('coco', coco) net.set_ph(image, image_id, num_pos, Human_augmented, Object_augmented, action_HO, sp) from models.train_Solver_HICO import train_net train_net(net, Trainval_GT, Trainval_N, output_dir, tb_dir,
if args.model.__contains__('res101'): os.environ['DATASET'] = 'HICO_res101' from networks.HOI import DisentanglingNet net = DisentanglingNet(model_name=args.model) else: from networks.HOI import DisentanglingNet net = DisentanglingNet(model_name=args.model) os.environ['FEATS'] = 'TRUE' if args.type == 'train': large_neg_for_ho = False if args.model.endswith('_aug5_new') or args.model.endswith( '_aug6_new'): large_neg_for_ho = True image, image_id, num_pos, Human_augmented, Object_augmented, action_HO, sp = obtain_data( Pos_augment=0, Neg_select=0, augment_type=-1, pattern_type=False) net.set_ph(image, image_id, num_pos, Human_augmented, Object_augmented, action_HO, sp) else: large_neg_for_ho = False image, image_id, num_pos, Human_augmented, Object_augmented, action_HO, sp = obtain_test_data( Pos_augment=0, Neg_select=0, augment_type=-1, large_neg_for_ho=large_neg_for_ho) net.set_ph(image, image_id, num_pos, Human_augmented, Object_augmented, action_HO, sp) net.init_verbs_objs_cls() net.create_architecture(False)
augment_type = get_augment_type(args.model) start_epoch = 0 net = ResNet101(model_name=args.model) pattern_type = 0 neg_type_ratio = 0 zero_shot_type = get_zero_shot_type(args.model) human_adj = None obj_adj = None image, image_id, num_pos, Human_augmented, Object_augmented, action_HO, sp, obj_mask = obtain_data( Pos_augment=args.Pos_augment, Neg_select=args.Neg_select, augment_type=augment_type, pattern_type=pattern_type, zero_shot_type=zero_shot_type, epoch=start_epoch, neg_type=neg_type_ratio) net.set_ph(image, image_id, num_pos, Human_augmented, Object_augmented, action_HO, sp) if args.model.__contains__('gan'): from models.train_Solver_HICO_FCL import train_net else: from models.train_Solver_HICO import train_net train_net(net, Trainval_GT, Trainval_N, output_dir,