Spaces:
Sleeping
Sleeping
alrichardbollans commited on
Commit ·
d49211e
1
Parent(s): 4aa953a
Fix name error for USE_FED_LOSS
Browse files- python_utils/get_model.py +1 -10
python_utils/get_model.py
CHANGED
|
@@ -10,18 +10,9 @@ def get_set_up():
|
|
| 10 |
|
| 11 |
def load_model():
|
| 12 |
# return None
|
| 13 |
-
# def predictor(img):
|
| 14 |
-
# return {}
|
| 15 |
-
# return predictor
|
| 16 |
-
# import some common detectron2 utilities
|
| 17 |
import torch
|
| 18 |
-
from detectron2 import model_zoo
|
| 19 |
from detectron2.engine import DefaultPredictor
|
| 20 |
from detectron2.config import get_cfg
|
| 21 |
-
from detectron2.data.datasets import register_coco_instances
|
| 22 |
-
|
| 23 |
-
import os
|
| 24 |
-
import numpy as np
|
| 25 |
|
| 26 |
## define relevant parameters
|
| 27 |
cfg = get_cfg()
|
|
@@ -37,7 +28,7 @@ def load_model():
|
|
| 37 |
## some messages will appear when using the model that certain weights are not being used
|
| 38 |
## but these are used during training and not inference and shouldn't affect the model performance
|
| 39 |
## code below
|
| 40 |
-
cfg.MODEL.ROI_BOX_HEAD.USE_FED_LOSS =
|
| 41 |
|
| 42 |
predictor = DefaultPredictor(cfg)
|
| 43 |
|
|
|
|
| 10 |
|
| 11 |
def load_model():
|
| 12 |
# return None
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
import torch
|
|
|
|
| 14 |
from detectron2.engine import DefaultPredictor
|
| 15 |
from detectron2.config import get_cfg
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
## define relevant parameters
|
| 18 |
cfg = get_cfg()
|
|
|
|
| 28 |
## some messages will appear when using the model that certain weights are not being used
|
| 29 |
## but these are used during training and not inference and shouldn't affect the model performance
|
| 30 |
## code below
|
| 31 |
+
cfg.MODEL.ROI_BOX_HEAD.USE_FED_LOSS = False
|
| 32 |
|
| 33 |
predictor = DefaultPredictor(cfg)
|
| 34 |
|