Giter Site home page Giter Site logo

Comments (3)

cnut1648 avatar cnut1648 commented on May 29, 2024 1

After several days I have been successfully reproduce the result! Here is my attempt. The code is using python3 and contains FCN training code (use torchvision) and also object detection module (using detectron2). Thank you again for the authors' great work!

from syndata-generation.

cnut1648 avatar cnut1648 commented on May 29, 2024

An update, so I have trained Detectron2 faster rcnn (pretrained on COCO), and the result are quite low
image

I think I kept the original parameters, and my config is below

class Trainer(DefaultTrainer):
    @classmethod
    def build_evaluator(cls, cfg, dataset_name):
        return COCOEvaluator("synthetic_train", output_dir=os.path.join(cfg.OUTPUT_DIR, "eval", dataset_name))

with open(cutpasted_dir / "label2id.json") as f:
        label2id = json.load(f)

from PIL import ImageFile, Image
ImageFile.LOAD_TRUNCATED_IMAGES = True

register_coco_instances("synthetic_train", metadata=label2id, json_file=str(cutpasted_dir / "COCO.json"), image_root=str(cutpasted_dir / "images"))
register_coco_instances("kitchen_test", metadata={}, json_file=str(data_dir / "Kitchen_fold1_COCO.json"), image_root="")
cfg = get_cfg()

cfg.merge_from_file(model_zoo.get_config_file("COCO-Detection/faster_rcnn_R_50_FPN_3x.yaml"))
cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = 0.5  # set threshold for this model
cfg.MODEL.WEIGHTS = model_zoo.get_checkpoint_url("COCO-Detection/faster_rcnn_R_50_FPN_3x.yaml")
cfg.MODEL.ROI_HEADS.BATCH_SIZE_PER_IMAGE = 256
cfg.MODEL.ROI_HEADS.NUM_CLASSES = len(label2id)

cfg.DATASETS.TRAIN = ("synthetic_train",)
cfg.DATASETS.TEST = ("synthetic_train", )
cfg.DATALOADER.NUM_WORKERS = 10
cfg.TEST.EVAL_PERIOD = 5000

cfg.SEED = 42

cfg.SOLVER.IMS_PER_BATCH = 4
cfg.SOLVER.BASE_LR = 0.001
cfg.SOLVER.MAX_ITER = 25000
cfg.SOLVER.STEPS = (15000, )
cfg.SOLVER.WEIGHT_DECAY = 0.0005

os.makedirs(cfg.OUTPUT_DIR, exist_ok=True)
trainer = Trainer(cfg) 
trainer.resume_or_load(resume=False)
trainer.train()

what did I miss here? Thank you!

from syndata-generation.

zeldrinn avatar zeldrinn commented on May 29, 2024

@cnut1648 any chance you still have that code lying around? Getting a 404 :)

from syndata-generation.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.