laurenok24
commited on
Update models/detectron2/platform_detector_setup.py
Browse files
models/detectron2/platform_detector_setup.py
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
import sys, os, distutils.core
|
2 |
|
3 |
-
os.system('python -m pip install pyyaml==5.3.1')
|
4 |
-
dist = distutils.core.run_setup("./detectron2/setup.py")
|
5 |
-
temp = ' '.join([f"'{x}'" for x in dist.install_requires])
|
6 |
-
cmd = "python -m pip install {0}".format(temp)
|
7 |
-
os.system(cmd)
|
8 |
sys.path.insert(0, os.path.abspath('./detectron2'))
|
9 |
|
10 |
import detectron2
|
@@ -26,10 +26,10 @@ def get_platform_detector():
|
|
26 |
cfg = get_cfg()
|
27 |
cfg.OUTPUT_DIR = "./output/platform/"
|
28 |
# model = build_model(cfg) # returns a torch.nn.Module
|
29 |
-
cfg.merge_from_file(model_zoo.get_config_file("COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml"))
|
30 |
cfg.DATASETS.TEST = ()
|
31 |
cfg.DATALOADER.NUM_WORKERS = 2
|
32 |
-
cfg.MODEL.WEIGHTS = model_zoo.get_checkpoint_url("COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml") # Let training initialize from model zoo
|
33 |
cfg.SOLVER.IMS_PER_BATCH = 2 # This is the real "batch size" commonly known to deep learning people
|
34 |
cfg.SOLVER.BASE_LR = 0.00025 # pick a good LR
|
35 |
cfg.SOLVER.MAX_ITER = 300 # 300 iterations seems good enough for this toy dataset; you will need to train longer for a practical dataset
|
|
|
1 |
import sys, os, distutils.core
|
2 |
|
3 |
+
# os.system('python -m pip install pyyaml==5.3.1')
|
4 |
+
# dist = distutils.core.run_setup("./detectron2/setup.py")
|
5 |
+
# temp = ' '.join([f"'{x}'" for x in dist.install_requires])
|
6 |
+
# cmd = "python -m pip install {0}".format(temp)
|
7 |
+
# os.system(cmd)
|
8 |
sys.path.insert(0, os.path.abspath('./detectron2'))
|
9 |
|
10 |
import detectron2
|
|
|
26 |
cfg = get_cfg()
|
27 |
cfg.OUTPUT_DIR = "./output/platform/"
|
28 |
# model = build_model(cfg) # returns a torch.nn.Module
|
29 |
+
cfg.merge_from_file(model_zoo.get_config_file("configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml"))
|
30 |
cfg.DATASETS.TEST = ()
|
31 |
cfg.DATALOADER.NUM_WORKERS = 2
|
32 |
+
cfg.MODEL.WEIGHTS = model_zoo.get_checkpoint_url("configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml") # Let training initialize from model zoo
|
33 |
cfg.SOLVER.IMS_PER_BATCH = 2 # This is the real "batch size" commonly known to deep learning people
|
34 |
cfg.SOLVER.BASE_LR = 0.00025 # pick a good LR
|
35 |
cfg.SOLVER.MAX_ITER = 300 # 300 iterations seems good enough for this toy dataset; you will need to train longer for a practical dataset
|