source/containers/body-detection/detector/predictor.py [10:30]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
model_root_dir = '/opt/ml/model'
object_detection_model_name = os.environ.get('OBJECT_DETECTION_MODEL_NAME', 'yolo3_darknet53_coco')


# A singleton for holding the model. This simply loads the model and holds it.
# It has a predict function that does a prediction based on the model and the input data.
class ObjectDetectionService(object):
    # class attributes
    detector = None
    ctx = mx.cpu() if mx.context.num_gpus() == 0 else mx.gpu()

    @classmethod
    def get_model(cls):
        """
        Get the model object for this instance, loading it if it's not already loaded.

        :return:
        """
        if cls.detector is None:
            if object_detection_model_name == 'ssd_512_resnet50_v1_coco':
                cls.detector = gluon.nn.SymbolBlock.imports(
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



source/containers/face-detection/detector/predictor.py [10:30]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
model_root_dir = '/opt/ml/model'
object_detection_model_name = os.environ.get('OBJECT_DETECTION_MODEL_NAME', 'yolo3_darknet53_coco')


# A singleton for holding the model. This simply loads the model and holds it.
# It has a predict function that does a prediction based on the model and the input data.
class ObjectDetectionService(object):
    # class attributes
    detector = None
    ctx = mx.cpu() if mx.context.num_gpus() == 0 else mx.gpu()

    @classmethod
    def get_model(cls):
        """
        Get the model object for this instance, loading it if it's not already loaded.

        :return:
        """
        if cls.detector is None:
            if object_detection_model_name == 'ssd_512_resnet50_v1_coco':
                cls.detector = gluon.nn.SymbolBlock.imports(
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



