Tutorial about serverless functions (#3124)
Co-authored-by: Roman Donchenko <roman.donchenko@intel.com>main
@ -0,0 +1,136 @@
|
||||
metadata:
|
||||
name: pth.facebookresearch.detectron2.retinanet_r101
|
||||
namespace: cvat
|
||||
annotations:
|
||||
name: RetinaNet R101
|
||||
type: detector
|
||||
framework: pytorch
|
||||
spec: |
|
||||
[
|
||||
{ "id": 1, "name": "person" },
|
||||
{ "id": 2, "name": "bicycle" },
|
||||
{ "id": 3, "name": "car" },
|
||||
{ "id": 4, "name": "motorcycle" },
|
||||
{ "id": 5, "name": "airplane" },
|
||||
{ "id": 6, "name": "bus" },
|
||||
{ "id": 7, "name": "train" },
|
||||
{ "id": 8, "name": "truck" },
|
||||
{ "id": 9, "name": "boat" },
|
||||
{ "id":10, "name": "traffic_light" },
|
||||
{ "id":11, "name": "fire_hydrant" },
|
||||
{ "id":13, "name": "stop_sign" },
|
||||
{ "id":14, "name": "parking_meter" },
|
||||
{ "id":15, "name": "bench" },
|
||||
{ "id":16, "name": "bird" },
|
||||
{ "id":17, "name": "cat" },
|
||||
{ "id":18, "name": "dog" },
|
||||
{ "id":19, "name": "horse" },
|
||||
{ "id":20, "name": "sheep" },
|
||||
{ "id":21, "name": "cow" },
|
||||
{ "id":22, "name": "elephant" },
|
||||
{ "id":23, "name": "bear" },
|
||||
{ "id":24, "name": "zebra" },
|
||||
{ "id":25, "name": "giraffe" },
|
||||
{ "id":27, "name": "backpack" },
|
||||
{ "id":28, "name": "umbrella" },
|
||||
{ "id":31, "name": "handbag" },
|
||||
{ "id":32, "name": "tie" },
|
||||
{ "id":33, "name": "suitcase" },
|
||||
{ "id":34, "name": "frisbee" },
|
||||
{ "id":35, "name": "skis" },
|
||||
{ "id":36, "name": "snowboard" },
|
||||
{ "id":37, "name": "sports_ball" },
|
||||
{ "id":38, "name": "kite" },
|
||||
{ "id":39, "name": "baseball_bat" },
|
||||
{ "id":40, "name": "baseball_glove" },
|
||||
{ "id":41, "name": "skateboard" },
|
||||
{ "id":42, "name": "surfboard" },
|
||||
{ "id":43, "name": "tennis_racket" },
|
||||
{ "id":44, "name": "bottle" },
|
||||
{ "id":46, "name": "wine_glass" },
|
||||
{ "id":47, "name": "cup" },
|
||||
{ "id":48, "name": "fork" },
|
||||
{ "id":49, "name": "knife" },
|
||||
{ "id":50, "name": "spoon" },
|
||||
{ "id":51, "name": "bowl" },
|
||||
{ "id":52, "name": "banana" },
|
||||
{ "id":53, "name": "apple" },
|
||||
{ "id":54, "name": "sandwich" },
|
||||
{ "id":55, "name": "orange" },
|
||||
{ "id":56, "name": "broccoli" },
|
||||
{ "id":57, "name": "carrot" },
|
||||
{ "id":58, "name": "hot_dog" },
|
||||
{ "id":59, "name": "pizza" },
|
||||
{ "id":60, "name": "donut" },
|
||||
{ "id":61, "name": "cake" },
|
||||
{ "id":62, "name": "chair" },
|
||||
{ "id":63, "name": "couch" },
|
||||
{ "id":64, "name": "potted_plant" },
|
||||
{ "id":65, "name": "bed" },
|
||||
{ "id":67, "name": "dining_table" },
|
||||
{ "id":70, "name": "toilet" },
|
||||
{ "id":72, "name": "tv" },
|
||||
{ "id":73, "name": "laptop" },
|
||||
{ "id":74, "name": "mouse" },
|
||||
{ "id":75, "name": "remote" },
|
||||
{ "id":76, "name": "keyboard" },
|
||||
{ "id":77, "name": "cell_phone" },
|
||||
{ "id":78, "name": "microwave" },
|
||||
{ "id":79, "name": "oven" },
|
||||
{ "id":80, "name": "toaster" },
|
||||
{ "id":81, "name": "sink" },
|
||||
{ "id":83, "name": "refrigerator" },
|
||||
{ "id":84, "name": "book" },
|
||||
{ "id":85, "name": "clock" },
|
||||
{ "id":86, "name": "vase" },
|
||||
{ "id":87, "name": "scissors" },
|
||||
{ "id":88, "name": "teddy_bear" },
|
||||
{ "id":89, "name": "hair_drier" },
|
||||
{ "id":90, "name": "toothbrush" }
|
||||
]
|
||||
|
||||
spec:
|
||||
description: RetinaNet R101 from Detectron2 optimized for GPU
|
||||
runtime: 'python:3.8'
|
||||
handler: main:handler
|
||||
eventTimeout: 30s
|
||||
|
||||
build:
|
||||
image: cvat/pth.facebookresearch.detectron2.retinanet_r101
|
||||
baseImage: ubuntu:20.04
|
||||
|
||||
directives:
|
||||
preCopy:
|
||||
- kind: ENV
|
||||
value: DEBIAN_FRONTEND=noninteractive
|
||||
- kind: RUN
|
||||
value: apt-get update && apt-get -y install curl git python3 python3-pip
|
||||
- kind: WORKDIR
|
||||
value: /opt/nuclio
|
||||
- kind: RUN
|
||||
value: pip3 install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html
|
||||
- kind: RUN
|
||||
value: pip3 install 'git+https://github.com/facebookresearch/detectron2@v0.4'
|
||||
- kind: RUN
|
||||
value: curl -O https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/retinanet_R_101_FPN_3x/190397697/model_final_971ab9.pkl
|
||||
- kind: RUN
|
||||
value: ln -s /usr/bin/pip3 /usr/local/bin/pip
|
||||
|
||||
triggers:
|
||||
myHttpTrigger:
|
||||
maxWorkers: 1
|
||||
kind: 'http'
|
||||
workerAvailabilityTimeoutMilliseconds: 10000
|
||||
attributes:
|
||||
maxRequestBodySize: 33554432 # 32MB
|
||||
|
||||
resources:
|
||||
limits:
|
||||
nvidia.com/gpu: 1
|
||||
|
||||
platform:
|
||||
attributes:
|
||||
restartPolicy:
|
||||
name: always
|
||||
maximumRetryCount: 3
|
||||
mountMode: volume
|
||||
@ -0,0 +1,132 @@
|
||||
metadata:
|
||||
name: pth.facebookresearch.detectron2.retinanet_r101
|
||||
namespace: cvat
|
||||
annotations:
|
||||
name: RetinaNet R101
|
||||
type: detector
|
||||
framework: pytorch
|
||||
spec: |
|
||||
[
|
||||
{ "id": 1, "name": "person" },
|
||||
{ "id": 2, "name": "bicycle" },
|
||||
{ "id": 3, "name": "car" },
|
||||
{ "id": 4, "name": "motorcycle" },
|
||||
{ "id": 5, "name": "airplane" },
|
||||
{ "id": 6, "name": "bus" },
|
||||
{ "id": 7, "name": "train" },
|
||||
{ "id": 8, "name": "truck" },
|
||||
{ "id": 9, "name": "boat" },
|
||||
{ "id":10, "name": "traffic_light" },
|
||||
{ "id":11, "name": "fire_hydrant" },
|
||||
{ "id":13, "name": "stop_sign" },
|
||||
{ "id":14, "name": "parking_meter" },
|
||||
{ "id":15, "name": "bench" },
|
||||
{ "id":16, "name": "bird" },
|
||||
{ "id":17, "name": "cat" },
|
||||
{ "id":18, "name": "dog" },
|
||||
{ "id":19, "name": "horse" },
|
||||
{ "id":20, "name": "sheep" },
|
||||
{ "id":21, "name": "cow" },
|
||||
{ "id":22, "name": "elephant" },
|
||||
{ "id":23, "name": "bear" },
|
||||
{ "id":24, "name": "zebra" },
|
||||
{ "id":25, "name": "giraffe" },
|
||||
{ "id":27, "name": "backpack" },
|
||||
{ "id":28, "name": "umbrella" },
|
||||
{ "id":31, "name": "handbag" },
|
||||
{ "id":32, "name": "tie" },
|
||||
{ "id":33, "name": "suitcase" },
|
||||
{ "id":34, "name": "frisbee" },
|
||||
{ "id":35, "name": "skis" },
|
||||
{ "id":36, "name": "snowboard" },
|
||||
{ "id":37, "name": "sports_ball" },
|
||||
{ "id":38, "name": "kite" },
|
||||
{ "id":39, "name": "baseball_bat" },
|
||||
{ "id":40, "name": "baseball_glove" },
|
||||
{ "id":41, "name": "skateboard" },
|
||||
{ "id":42, "name": "surfboard" },
|
||||
{ "id":43, "name": "tennis_racket" },
|
||||
{ "id":44, "name": "bottle" },
|
||||
{ "id":46, "name": "wine_glass" },
|
||||
{ "id":47, "name": "cup" },
|
||||
{ "id":48, "name": "fork" },
|
||||
{ "id":49, "name": "knife" },
|
||||
{ "id":50, "name": "spoon" },
|
||||
{ "id":51, "name": "bowl" },
|
||||
{ "id":52, "name": "banana" },
|
||||
{ "id":53, "name": "apple" },
|
||||
{ "id":54, "name": "sandwich" },
|
||||
{ "id":55, "name": "orange" },
|
||||
{ "id":56, "name": "broccoli" },
|
||||
{ "id":57, "name": "carrot" },
|
||||
{ "id":58, "name": "hot_dog" },
|
||||
{ "id":59, "name": "pizza" },
|
||||
{ "id":60, "name": "donut" },
|
||||
{ "id":61, "name": "cake" },
|
||||
{ "id":62, "name": "chair" },
|
||||
{ "id":63, "name": "couch" },
|
||||
{ "id":64, "name": "potted_plant" },
|
||||
{ "id":65, "name": "bed" },
|
||||
{ "id":67, "name": "dining_table" },
|
||||
{ "id":70, "name": "toilet" },
|
||||
{ "id":72, "name": "tv" },
|
||||
{ "id":73, "name": "laptop" },
|
||||
{ "id":74, "name": "mouse" },
|
||||
{ "id":75, "name": "remote" },
|
||||
{ "id":76, "name": "keyboard" },
|
||||
{ "id":77, "name": "cell_phone" },
|
||||
{ "id":78, "name": "microwave" },
|
||||
{ "id":79, "name": "oven" },
|
||||
{ "id":80, "name": "toaster" },
|
||||
{ "id":81, "name": "sink" },
|
||||
{ "id":83, "name": "refrigerator" },
|
||||
{ "id":84, "name": "book" },
|
||||
{ "id":85, "name": "clock" },
|
||||
{ "id":86, "name": "vase" },
|
||||
{ "id":87, "name": "scissors" },
|
||||
{ "id":88, "name": "teddy_bear" },
|
||||
{ "id":89, "name": "hair_drier" },
|
||||
{ "id":90, "name": "toothbrush" }
|
||||
]
|
||||
|
||||
spec:
|
||||
description: RetinaNet R101 from Detectron2
|
||||
runtime: 'python:3.8'
|
||||
handler: main:handler
|
||||
eventTimeout: 30s
|
||||
|
||||
build:
|
||||
image: cvat/pth.facebookresearch.detectron2.retinanet_r101
|
||||
baseImage: ubuntu:20.04
|
||||
|
||||
directives:
|
||||
preCopy:
|
||||
- kind: ENV
|
||||
value: DEBIAN_FRONTEND=noninteractive
|
||||
- kind: RUN
|
||||
value: apt-get update && apt-get -y install curl git python3 python3-pip
|
||||
- kind: WORKDIR
|
||||
value: /opt/nuclio
|
||||
- kind: RUN
|
||||
value: pip3 install torch==1.8.1+cpu torchvision==0.9.1+cpu torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html
|
||||
- kind: RUN
|
||||
value: pip3 install 'git+https://github.com/facebookresearch/detectron2@v0.4'
|
||||
- kind: RUN
|
||||
value: curl -O https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/retinanet_R_101_FPN_3x/190397697/model_final_971ab9.pkl
|
||||
- kind: RUN
|
||||
value: ln -s /usr/bin/pip3 /usr/local/bin/pip
|
||||
|
||||
triggers:
|
||||
myHttpTrigger:
|
||||
maxWorkers: 2
|
||||
kind: 'http'
|
||||
workerAvailabilityTimeoutMilliseconds: 10000
|
||||
attributes:
|
||||
maxRequestBodySize: 33554432 # 32MB
|
||||
|
||||
platform:
|
||||
attributes:
|
||||
restartPolicy:
|
||||
name: always
|
||||
maximumRetryCount: 3
|
||||
mountMode: volume
|
||||
@ -0,0 +1,60 @@
|
||||
import json
|
||||
import base64
|
||||
import io
|
||||
from PIL import Image
|
||||
|
||||
import torch
|
||||
from detectron2.model_zoo import get_config
|
||||
from detectron2.data.detection_utils import convert_PIL_to_numpy
|
||||
from detectron2.engine.defaults import DefaultPredictor
|
||||
from detectron2.data.datasets.builtin_meta import COCO_CATEGORIES
|
||||
|
||||
CONFIG_OPTS = ["MODEL.WEIGHTS", "model_final_971ab9.pkl"]
|
||||
CONFIDENCE_THRESHOLD = 0.5
|
||||
|
||||
def init_context(context):
|
||||
context.logger.info("Init context... 0%")
|
||||
|
||||
cfg = get_config('COCO-Detection/retinanet_R_101_FPN_3x.yaml')
|
||||
if torch.cuda.is_available():
|
||||
CONFIG_OPTS.extend(['MODEL.DEVICE', 'cuda'])
|
||||
else:
|
||||
CONFIG_OPTS.extend(['MODEL.DEVICE', 'cpu'])
|
||||
|
||||
cfg.merge_from_list(CONFIG_OPTS)
|
||||
cfg.MODEL.RETINANET.SCORE_THRESH_TEST = CONFIDENCE_THRESHOLD
|
||||
cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = CONFIDENCE_THRESHOLD
|
||||
cfg.MODEL.PANOPTIC_FPN.COMBINE.INSTANCES_CONFIDENCE_THRESH = CONFIDENCE_THRESHOLD
|
||||
cfg.freeze()
|
||||
predictor = DefaultPredictor(cfg)
|
||||
|
||||
context.user_data.model_handler = predictor
|
||||
|
||||
context.logger.info("Init context...100%")
|
||||
|
||||
def handler(context, event):
|
||||
context.logger.info("Run retinanet-R101 model")
|
||||
data = event.body
|
||||
buf = io.BytesIO(base64.b64decode(data["image"]))
|
||||
threshold = float(data.get("threshold", 0.5))
|
||||
image = convert_PIL_to_numpy(Image.open(buf), format="BGR")
|
||||
|
||||
predictions = context.user_data.model_handler(image)
|
||||
|
||||
instances = predictions['instances']
|
||||
pred_boxes = instances.pred_boxes
|
||||
scores = instances.scores
|
||||
pred_classes = instances.pred_classes
|
||||
results = []
|
||||
for box, score, label in zip(pred_boxes, scores, pred_classes):
|
||||
label = COCO_CATEGORIES[int(label)]["name"]
|
||||
if score >= threshold:
|
||||
results.append({
|
||||
"confidence": str(float(score)),
|
||||
"label": label,
|
||||
"points": box.tolist(),
|
||||
"type": "rectangle",
|
||||
})
|
||||
|
||||
return context.Response(body=json.dumps(results), headers={},
|
||||
content_type='application/json', status_code=200)
|
||||
@ -0,0 +1,136 @@
|
||||
metadata:
|
||||
name: tf-faster-rcnn-inception-v2-coco
|
||||
namespace: cvat
|
||||
annotations:
|
||||
name: Faster RCNN via Tensorflow
|
||||
type: detector
|
||||
framework: tensorflow
|
||||
spec: |
|
||||
[
|
||||
{ "id": 1, "name": "person" },
|
||||
{ "id": 2, "name": "bicycle" },
|
||||
{ "id": 3, "name": "car" },
|
||||
{ "id": 4, "name": "motorcycle" },
|
||||
{ "id": 5, "name": "airplane" },
|
||||
{ "id": 6, "name": "bus" },
|
||||
{ "id": 7, "name": "train" },
|
||||
{ "id": 8, "name": "truck" },
|
||||
{ "id": 9, "name": "boat" },
|
||||
{ "id":10, "name": "traffic_light" },
|
||||
{ "id":11, "name": "fire_hydrant" },
|
||||
{ "id":13, "name": "stop_sign" },
|
||||
{ "id":14, "name": "parking_meter" },
|
||||
{ "id":15, "name": "bench" },
|
||||
{ "id":16, "name": "bird" },
|
||||
{ "id":17, "name": "cat" },
|
||||
{ "id":18, "name": "dog" },
|
||||
{ "id":19, "name": "horse" },
|
||||
{ "id":20, "name": "sheep" },
|
||||
{ "id":21, "name": "cow" },
|
||||
{ "id":22, "name": "elephant" },
|
||||
{ "id":23, "name": "bear" },
|
||||
{ "id":24, "name": "zebra" },
|
||||
{ "id":25, "name": "giraffe" },
|
||||
{ "id":27, "name": "backpack" },
|
||||
{ "id":28, "name": "umbrella" },
|
||||
{ "id":31, "name": "handbag" },
|
||||
{ "id":32, "name": "tie" },
|
||||
{ "id":33, "name": "suitcase" },
|
||||
{ "id":34, "name": "frisbee" },
|
||||
{ "id":35, "name": "skis" },
|
||||
{ "id":36, "name": "snowboard" },
|
||||
{ "id":37, "name": "sports_ball" },
|
||||
{ "id":38, "name": "kite" },
|
||||
{ "id":39, "name": "baseball_bat" },
|
||||
{ "id":40, "name": "baseball_glove" },
|
||||
{ "id":41, "name": "skateboard" },
|
||||
{ "id":42, "name": "surfboard" },
|
||||
{ "id":43, "name": "tennis_racket" },
|
||||
{ "id":44, "name": "bottle" },
|
||||
{ "id":46, "name": "wine_glass" },
|
||||
{ "id":47, "name": "cup" },
|
||||
{ "id":48, "name": "fork" },
|
||||
{ "id":49, "name": "knife" },
|
||||
{ "id":50, "name": "spoon" },
|
||||
{ "id":51, "name": "bowl" },
|
||||
{ "id":52, "name": "banana" },
|
||||
{ "id":53, "name": "apple" },
|
||||
{ "id":54, "name": "sandwich" },
|
||||
{ "id":55, "name": "orange" },
|
||||
{ "id":56, "name": "broccoli" },
|
||||
{ "id":57, "name": "carrot" },
|
||||
{ "id":58, "name": "hot_dog" },
|
||||
{ "id":59, "name": "pizza" },
|
||||
{ "id":60, "name": "donut" },
|
||||
{ "id":61, "name": "cake" },
|
||||
{ "id":62, "name": "chair" },
|
||||
{ "id":63, "name": "couch" },
|
||||
{ "id":64, "name": "potted_plant" },
|
||||
{ "id":65, "name": "bed" },
|
||||
{ "id":67, "name": "dining_table" },
|
||||
{ "id":70, "name": "toilet" },
|
||||
{ "id":72, "name": "tv" },
|
||||
{ "id":73, "name": "laptop" },
|
||||
{ "id":74, "name": "mouse" },
|
||||
{ "id":75, "name": "remote" },
|
||||
{ "id":76, "name": "keyboard" },
|
||||
{ "id":77, "name": "cell_phone" },
|
||||
{ "id":78, "name": "microwave" },
|
||||
{ "id":79, "name": "oven" },
|
||||
{ "id":80, "name": "toaster" },
|
||||
{ "id":81, "name": "sink" },
|
||||
{ "id":83, "name": "refrigerator" },
|
||||
{ "id":84, "name": "book" },
|
||||
{ "id":85, "name": "clock" },
|
||||
{ "id":86, "name": "vase" },
|
||||
{ "id":87, "name": "scissors" },
|
||||
{ "id":88, "name": "teddy_bear" },
|
||||
{ "id":89, "name": "hair_drier" },
|
||||
{ "id":90, "name": "toothbrush" }
|
||||
]
|
||||
|
||||
spec:
|
||||
description: Faster RCNN from Tensorflow Object Detection API optimized for GPU
|
||||
runtime: 'python:3.6'
|
||||
handler: main:handler
|
||||
eventTimeout: 30s
|
||||
|
||||
build:
|
||||
image: cvat/tf.faster_rcnn_inception_v2_coco
|
||||
baseImage: tensorflow/tensorflow:2.1.1-gpu
|
||||
|
||||
directives:
|
||||
preCopy:
|
||||
- kind: RUN
|
||||
value: apt install curl
|
||||
- kind: WORKDIR
|
||||
value: /opt/nuclio
|
||||
|
||||
postCopy:
|
||||
- kind: RUN
|
||||
value:
|
||||
curl -O http://download.tensorflow.org/models/object_detection/faster_rcnn_inception_v2_coco_2018_01_28.tar.gz &&
|
||||
tar -xzf faster_rcnn_inception_v2_coco_2018_01_28.tar.gz && rm faster_rcnn_inception_v2_coco_2018_01_28.tar.gz
|
||||
- kind: RUN
|
||||
value: ln -s faster_rcnn_inception_v2_coco_2018_01_28 faster_rcnn
|
||||
- kind: RUN
|
||||
value: pip install pillow pyyaml
|
||||
|
||||
triggers:
|
||||
myHttpTrigger:
|
||||
maxWorkers: 1
|
||||
kind: 'http'
|
||||
workerAvailabilityTimeoutMilliseconds: 10000
|
||||
attributes:
|
||||
maxRequestBodySize: 33554432 # 32MB
|
||||
|
||||
resources:
|
||||
limits:
|
||||
nvidia.com/gpu: 1
|
||||
|
||||
platform:
|
||||
attributes:
|
||||
restartPolicy:
|
||||
name: always
|
||||
maximumRetryCount: 3
|
||||
mountMode: volume
|
||||
@ -0,0 +1,135 @@
|
||||
metadata:
|
||||
name: tf-matterport-mask-rcnn
|
||||
namespace: cvat
|
||||
annotations:
|
||||
name: Mask RCNN via Tensorflow
|
||||
type: detector
|
||||
framework: tensorflow
|
||||
spec: |
|
||||
[
|
||||
{ "id": 0, "name": "BG" },
|
||||
{ "id": 1, "name": "person" },
|
||||
{ "id": 2, "name": "bicycle" },
|
||||
{ "id": 3, "name": "car" },
|
||||
{ "id": 4, "name": "motorcycle" },
|
||||
{ "id": 5, "name": "airplane" },
|
||||
{ "id": 6, "name": "bus" },
|
||||
{ "id": 7, "name": "train" },
|
||||
{ "id": 8, "name": "truck" },
|
||||
{ "id": 9, "name": "boat" },
|
||||
{ "id": 10, "name": "traffic_light" },
|
||||
{ "id": 11, "name": "fire_hydrant" },
|
||||
{ "id": 12, "name": "stop_sign" },
|
||||
{ "id": 13, "name": "parking_meter" },
|
||||
{ "id": 14, "name": "bench" },
|
||||
{ "id": 15, "name": "bird" },
|
||||
{ "id": 16, "name": "cat" },
|
||||
{ "id": 17, "name": "dog" },
|
||||
{ "id": 18, "name": "horse" },
|
||||
{ "id": 19, "name": "sheep" },
|
||||
{ "id": 20, "name": "cow" },
|
||||
{ "id": 21, "name": "elephant" },
|
||||
{ "id": 22, "name": "bear" },
|
||||
{ "id": 23, "name": "zebra" },
|
||||
{ "id": 24, "name": "giraffe" },
|
||||
{ "id": 25, "name": "backpack" },
|
||||
{ "id": 26, "name": "umbrella" },
|
||||
{ "id": 27, "name": "handbag" },
|
||||
{ "id": 28, "name": "tie" },
|
||||
{ "id": 29, "name": "suitcase" },
|
||||
{ "id": 30, "name": "frisbee" },
|
||||
{ "id": 31, "name": "skis" },
|
||||
{ "id": 32, "name": "snowboard" },
|
||||
{ "id": 33, "name": "sports_ball" },
|
||||
{ "id": 34, "name": "kite" },
|
||||
{ "id": 35, "name": "baseball_bat" },
|
||||
{ "id": 36, "name": "baseball_glove" },
|
||||
{ "id": 37, "name": "skateboard" },
|
||||
{ "id": 38, "name": "surfboard" },
|
||||
{ "id": 39, "name": "tennis_racket" },
|
||||
{ "id": 40, "name": "bottle" },
|
||||
{ "id": 41, "name": "wine_glass" },
|
||||
{ "id": 42, "name": "cup" },
|
||||
{ "id": 43, "name": "fork" },
|
||||
{ "id": 44, "name": "knife" },
|
||||
{ "id": 45, "name": "spoon" },
|
||||
{ "id": 46, "name": "bowl" },
|
||||
{ "id": 47, "name": "banana" },
|
||||
{ "id": 48, "name": "apple" },
|
||||
{ "id": 49, "name": "sandwich" },
|
||||
{ "id": 50, "name": "orange" },
|
||||
{ "id": 51, "name": "broccoli" },
|
||||
{ "id": 52, "name": "carrot" },
|
||||
{ "id": 53, "name": "hot_dog" },
|
||||
{ "id": 54, "name": "pizza" },
|
||||
{ "id": 55, "name": "donut" },
|
||||
{ "id": 56, "name": "cake" },
|
||||
{ "id": 57, "name": "chair" },
|
||||
{ "id": 58, "name": "couch" },
|
||||
{ "id": 59, "name": "potted_plant" },
|
||||
{ "id": 60, "name": "bed" },
|
||||
{ "id": 61, "name": "dining_table" },
|
||||
{ "id": 62, "name": "toilet" },
|
||||
{ "id": 63, "name": "tv" },
|
||||
{ "id": 64, "name": "laptop" },
|
||||
{ "id": 65, "name": "mouse" },
|
||||
{ "id": 66, "name": "remote" },
|
||||
{ "id": 67, "name": "keyboard" },
|
||||
{ "id": 68, "name": "cell_phone" },
|
||||
{ "id": 69, "name": "microwave" },
|
||||
{ "id": 70, "name": "oven" },
|
||||
{ "id": 71, "name": "toaster" },
|
||||
{ "id": 72, "name": "sink" },
|
||||
{ "id": 73, "name": "refrigerator" },
|
||||
{ "id": 74, "name": "book" },
|
||||
{ "id": 75, "name": "clock" },
|
||||
{ "id": 76, "name": "vase" },
|
||||
{ "id": 77, "name": "scissors" },
|
||||
{ "id": 78, "name": "teddy_bear" },
|
||||
{ "id": 79, "name": "hair_drier" },
|
||||
{ "id": 80, "name": "toothbrush" }
|
||||
]
|
||||
|
||||
spec:
|
||||
description: Mask RCNN optimized for GPU
|
||||
|
||||
runtime: 'python:3.6'
|
||||
handler: main:handler
|
||||
eventTimeout: 30s
|
||||
env:
|
||||
- name: MASK_RCNN_DIR
|
||||
value: /opt/nuclio/Mask_RCNN
|
||||
build:
|
||||
image: cvat/tf.matterport.mask_rcnn
|
||||
baseImage: tensorflow/tensorflow:1.15.5-gpu-py3
|
||||
directives:
|
||||
postCopy:
|
||||
- kind: WORKDIR
|
||||
value: /opt/nuclio
|
||||
- kind: RUN
|
||||
value: apt update && apt install --no-install-recommends -y git curl
|
||||
- kind: RUN
|
||||
value: git clone --depth 1 https://github.com/matterport/Mask_RCNN.git
|
||||
- kind: RUN
|
||||
value: curl -L https://github.com/matterport/Mask_RCNN/releases/download/v2.0/mask_rcnn_coco.h5 -o Mask_RCNN/mask_rcnn_coco.h5
|
||||
- kind: RUN
|
||||
value: pip3 install numpy cython pyyaml keras==2.1.0 scikit-image Pillow
|
||||
|
||||
triggers:
|
||||
myHttpTrigger:
|
||||
maxWorkers: 1
|
||||
kind: 'http'
|
||||
workerAvailabilityTimeoutMilliseconds: 10000
|
||||
attributes:
|
||||
maxRequestBodySize: 33554432 # 32MB
|
||||
|
||||
resources:
|
||||
limits:
|
||||
nvidia.com/gpu: 1
|
||||
|
||||
platform:
|
||||
attributes:
|
||||
restartPolicy:
|
||||
name: always
|
||||
maximumRetryCount: 3
|
||||
mountMode: volume
|
||||
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 371 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 255 KiB After Width: | Height: | Size: 249 KiB |
|
Before Width: | Height: | Size: 107 KiB After Width: | Height: | Size: 102 KiB |
|
Before Width: | Height: | Size: 425 KiB After Width: | Height: | Size: 387 KiB |
|
Before Width: | Height: | Size: 135 KiB After Width: | Height: | Size: 112 KiB |
|
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 159 KiB After Width: | Height: | Size: 139 KiB |
|
Before Width: | Height: | Size: 132 KiB After Width: | Height: | Size: 108 KiB |
|
Before Width: | Height: | Size: 163 KiB After Width: | Height: | Size: 140 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 47 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 9.6 KiB |
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 724 B |
|
Before Width: | Height: | Size: 969 B After Width: | Height: | Size: 628 B |
|
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 99 KiB |
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 701 B |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 863 B |
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 343 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 374 KiB |
|
After Width: | Height: | Size: 194 KiB |
|
After Width: | Height: | Size: 170 KiB |
|
Before Width: | Height: | Size: 849 KiB After Width: | Height: | Size: 507 KiB |
|
After Width: | Height: | Size: 360 KiB |