-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Expand file tree
/
Copy pathfunction.yaml
More file actions
144 lines (139 loc) · 6.46 KB
/
function.yaml
File metadata and controls
144 lines (139 loc) · 6.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
metadata:
name: pth-facebookresearch-detectron2-retinanet-r101
namespace: cvat
annotations:
name: RetinaNet R101
type: detector
spec: |
[
{ "id": 1, "name": "person", "type": "rectangle" },
{ "id": 2, "name": "bicycle", "type": "rectangle" },
{ "id": 3, "name": "car", "type": "rectangle" },
{ "id": 4, "name": "motorcycle", "type": "rectangle" },
{ "id": 5, "name": "airplane", "type": "rectangle" },
{ "id": 6, "name": "bus", "type": "rectangle" },
{ "id": 7, "name": "train", "type": "rectangle" },
{ "id": 8, "name": "truck", "type": "rectangle" },
{ "id": 9, "name": "boat", "type": "rectangle" },
{ "id":10, "name": "traffic_light", "type": "rectangle" },
{ "id":11, "name": "fire_hydrant", "type": "rectangle" },
{ "id":13, "name": "stop_sign", "type": "rectangle" },
{ "id":14, "name": "parking_meter", "type": "rectangle" },
{ "id":15, "name": "bench", "type": "rectangle" },
{ "id":16, "name": "bird", "type": "rectangle" },
{ "id":17, "name": "cat", "type": "rectangle" },
{ "id":18, "name": "dog", "type": "rectangle" },
{ "id":19, "name": "horse", "type": "rectangle" },
{ "id":20, "name": "sheep", "type": "rectangle" },
{ "id":21, "name": "cow", "type": "rectangle" },
{ "id":22, "name": "elephant", "type": "rectangle" },
{ "id":23, "name": "bear", "type": "rectangle" },
{ "id":24, "name": "zebra", "type": "rectangle" },
{ "id":25, "name": "giraffe", "type": "rectangle" },
{ "id":27, "name": "backpack", "type": "rectangle" },
{ "id":28, "name": "umbrella", "type": "rectangle" },
{ "id":31, "name": "handbag", "type": "rectangle" },
{ "id":32, "name": "tie", "type": "rectangle" },
{ "id":33, "name": "suitcase", "type": "rectangle" },
{ "id":34, "name": "frisbee", "type": "rectangle" },
{ "id":35, "name": "skis", "type": "rectangle" },
{ "id":36, "name": "snowboard", "type": "rectangle" },
{ "id":37, "name": "sports_ball", "type": "rectangle" },
{ "id":38, "name": "kite", "type": "rectangle" },
{ "id":39, "name": "baseball_bat", "type": "rectangle" },
{ "id":40, "name": "baseball_glove", "type": "rectangle" },
{ "id":41, "name": "skateboard", "type": "rectangle" },
{ "id":42, "name": "surfboard", "type": "rectangle" },
{ "id":43, "name": "tennis_racket", "type": "rectangle" },
{ "id":44, "name": "bottle", "type": "rectangle" },
{ "id":46, "name": "wine_glass", "type": "rectangle" },
{ "id":47, "name": "cup", "type": "rectangle" },
{ "id":48, "name": "fork", "type": "rectangle" },
{ "id":49, "name": "knife", "type": "rectangle" },
{ "id":50, "name": "spoon", "type": "rectangle" },
{ "id":51, "name": "bowl", "type": "rectangle" },
{ "id":52, "name": "banana", "type": "rectangle" },
{ "id":53, "name": "apple", "type": "rectangle" },
{ "id":54, "name": "sandwich", "type": "rectangle" },
{ "id":55, "name": "orange", "type": "rectangle" },
{ "id":56, "name": "broccoli", "type": "rectangle" },
{ "id":57, "name": "carrot", "type": "rectangle" },
{ "id":58, "name": "hot_dog", "type": "rectangle" },
{ "id":59, "name": "pizza", "type": "rectangle" },
{ "id":60, "name": "donut", "type": "rectangle" },
{ "id":61, "name": "cake", "type": "rectangle" },
{ "id":62, "name": "chair", "type": "rectangle" },
{ "id":63, "name": "couch", "type": "rectangle" },
{ "id":64, "name": "potted_plant", "type": "rectangle" },
{ "id":65, "name": "bed", "type": "rectangle" },
{ "id":67, "name": "dining_table", "type": "rectangle" },
{ "id":70, "name": "toilet", "type": "rectangle" },
{ "id":72, "name": "tv", "type": "rectangle" },
{ "id":73, "name": "laptop", "type": "rectangle" },
{ "id":74, "name": "mouse", "type": "rectangle" },
{ "id":75, "name": "remote", "type": "rectangle" },
{ "id":76, "name": "keyboard", "type": "rectangle" },
{ "id":77, "name": "cell_phone", "type": "rectangle" },
{ "id":78, "name": "microwave", "type": "rectangle" },
{ "id":79, "name": "oven", "type": "rectangle" },
{ "id":80, "name": "toaster", "type": "rectangle" },
{ "id":81, "name": "sink", "type": "rectangle" },
{ "id":83, "name": "refrigerator", "type": "rectangle" },
{ "id":84, "name": "book", "type": "rectangle" },
{ "id":85, "name": "clock", "type": "rectangle" },
{ "id":86, "name": "vase", "type": "rectangle" },
{ "id":87, "name": "scissors", "type": "rectangle" },
{ "id":88, "name": "teddy_bear", "type": "rectangle" },
{ "id":89, "name": "hair_drier", "type": "rectangle" },
{ "id":90, "name": "toothbrush", "type": "rectangle" }
]
spec:
description: RetinaNet R101 from Detectron2
runtime: 'python:3.10'
handler: main:handler
eventTimeout: 30s
build:
image: cvat.pth.facebookresearch.detectron2.retinanet_r101
baseImage: ubuntu:22.04
directives:
preCopy:
- kind: ENV
value: DEBIAN_FRONTEND=noninteractive
- kind: RUN
value: |-
apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
git \
g++ \
ca-certificates \
python-is-python3 \
python3 \
python3-dev \
python3-pip \
&& rm -rf /var/lib/apt/lists/*
- kind: RUN
value: |-
pip install \
torch==1.13.1+cpu torchvision==0.14.1+cpu numpy==1.26.4 \
--extra-index-url https://download.pytorch.org/whl/cpu \
--no-cache-dir
- kind: RUN
value: pip install 'git+https://github.com/facebookresearch/detectron2@ff53992b1985' --no-cache-dir
- kind: WORKDIR
value: /opt/nuclio
- kind: RUN
value: curl -O https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/retinanet_R_101_FPN_3x/190397697/model_final_971ab9.pkl
triggers:
myHttpTrigger:
numWorkers: 2
kind: 'http'
workerAvailabilityTimeoutMilliseconds: 10000
attributes:
maxRequestBodySize: 33554432 # 32MB
platform:
attributes:
restartPolicy:
name: always
maximumRetryCount: 3
mountMode: volume