I have register my dataset and the CLASS_NAMES before training my dataset,and it does work for train,however when I test
my picture,the CLASS_NAMES of ouput is wrong,the CLASS_NAMES of output is coco's CLASS_NAMES ,is not my register CLASS_NAMES ,what is wrong? But when I trained my dataset for detectron2,it does not happend.
I have register my dataset and the CLASS_NAMES before training my dataset,and it does work for train,however when I test my picture,the CLASS_NAMES of ouput is wrong,the CLASS_NAMES of output is coco's CLASS_NAMES ,is not my register CLASS_NAMES ,what is wrong? But when I trained my dataset for detectron2,it does not happend.
This is my register code: `CLASS_NAMES =["hand"]
DATASET_ROOT = '/root/detectron2/AdelaiDet/datasets/handdata' ANN_ROOT = os.path.join(DATASET_ROOT, 'hand')
TRAIN_PATH = os.path.join(DATASET_ROOT, 'train') VAL_PATH = os.path.join(DATASET_ROOT, 'val')
TRAIN_JSON = os.path.join(ANN_ROOT, 'hand_train.json') VAL_JSON = os.path.join(ANN_ROOT, 'hand_val.json')
PREDEFINED_SPLITS_DATASET = { "coco_my_train": (TRAIN_PATH, TRAIN_JSON), "coco_my_val": (VAL_PATH, VAL_JSON), }
def plain_register_dataset(): DatasetCatalog.register("coco_my_train", lambda: load_coco_json(TRAIN_JSON, TRAIN_PATH)) MetadataCatalog.get("coco_my_train").set(thing_classes=CLASS_NAMES,
evaluator_type='coco', json_file=TRAIN_JSON, image_root=TRAIN_PATH) DatasetCatalog.register("coco_my_val", lambda: load_coco_json(VAL_JSON, VAL_PATH)) MetadataCatalog.get("coco_my_val").set(thing_classes=CLASS_NAMES evaluator_type='coco', json_file=VAL_JSON, image_root=VAL_PATH) `
if you know that ,please tell me ,thank you very much!