-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Expand file tree
/
Copy pathfunction-gpu.yaml
More file actions
130 lines (125 loc) · 6.07 KB
/
function-gpu.yaml
File metadata and controls
130 lines (125 loc) · 6.07 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
metadata:
name: onnx-wongkinyiu-yolov7
namespace: cvat
annotations:
name: YOLO v7
type: detector
spec: |
[
{ "id": 0, "name": "person", "type": "rectangle" },
{ "id": 1, "name": "bicycle", "type": "rectangle" },
{ "id": 2, "name": "car", "type": "rectangle" },
{ "id": 3, "name": "motorbike", "type": "rectangle" },
{ "id": 4, "name": "aeroplane", "type": "rectangle" },
{ "id": 5, "name": "bus", "type": "rectangle" },
{ "id": 6, "name": "train", "type": "rectangle" },
{ "id": 7, "name": "truck", "type": "rectangle" },
{ "id": 8, "name": "boat", "type": "rectangle" },
{ "id": 9, "name": "traffic light", "type": "rectangle" },
{ "id": 10, "name": "fire hydrant", "type": "rectangle" },
{ "id": 11, "name": "stop sign", "type": "rectangle" },
{ "id": 12, "name": "parking meter", "type": "rectangle" },
{ "id": 13, "name": "bench", "type": "rectangle" },
{ "id": 14, "name": "bird", "type": "rectangle" },
{ "id": 15, "name": "cat", "type": "rectangle" },
{ "id": 16, "name": "dog", "type": "rectangle" },
{ "id": 17, "name": "horse", "type": "rectangle" },
{ "id": 18, "name": "sheep", "type": "rectangle" },
{ "id": 19, "name": "cow", "type": "rectangle" },
{ "id": 20, "name": "elephant", "type": "rectangle" },
{ "id": 21, "name": "bear", "type": "rectangle" },
{ "id": 22, "name": "zebra", "type": "rectangle" },
{ "id": 23, "name": "giraffe", "type": "rectangle" },
{ "id": 24, "name": "backpack", "type": "rectangle" },
{ "id": 25, "name": "umbrella", "type": "rectangle" },
{ "id": 26, "name": "handbag", "type": "rectangle" },
{ "id": 27, "name": "tie", "type": "rectangle" },
{ "id": 28, "name": "suitcase", "type": "rectangle" },
{ "id": 29, "name": "frisbee", "type": "rectangle" },
{ "id": 30, "name": "skis", "type": "rectangle" },
{ "id": 31, "name": "snowboard", "type": "rectangle" },
{ "id": 32, "name": "sports ball", "type": "rectangle" },
{ "id": 33, "name": "kite", "type": "rectangle" },
{ "id": 34, "name": "baseball bat", "type": "rectangle" },
{ "id": 35, "name": "baseball glove", "type": "rectangle" },
{ "id": 36, "name": "skateboard", "type": "rectangle" },
{ "id": 37, "name": "surfboard", "type": "rectangle" },
{ "id": 38, "name": "tennis racket", "type": "rectangle" },
{ "id": 39, "name": "bottle", "type": "rectangle" },
{ "id": 40, "name": "wine glass", "type": "rectangle" },
{ "id": 41, "name": "cup", "type": "rectangle" },
{ "id": 42, "name": "fork", "type": "rectangle" },
{ "id": 43, "name": "knife", "type": "rectangle" },
{ "id": 44, "name": "spoon", "type": "rectangle" },
{ "id": 45, "name": "bowl", "type": "rectangle" },
{ "id": 46, "name": "banana", "type": "rectangle" },
{ "id": 47, "name": "apple", "type": "rectangle" },
{ "id": 48, "name": "sandwich", "type": "rectangle" },
{ "id": 49, "name": "orange", "type": "rectangle" },
{ "id": 50, "name": "broccoli", "type": "rectangle" },
{ "id": 51, "name": "carrot", "type": "rectangle" },
{ "id": 52, "name": "hot dog", "type": "rectangle" },
{ "id": 53, "name": "pizza", "type": "rectangle" },
{ "id": 54, "name": "donut", "type": "rectangle" },
{ "id": 55, "name": "cake", "type": "rectangle" },
{ "id": 56, "name": "chair", "type": "rectangle" },
{ "id": 57, "name": "sofa", "type": "rectangle" },
{ "id": 58, "name": "pottedplant", "type": "rectangle" },
{ "id": 59, "name": "bed", "type": "rectangle" },
{ "id": 60, "name": "diningtable", "type": "rectangle" },
{ "id": 61, "name": "toilet", "type": "rectangle" },
{ "id": 62, "name": "tvmonitor", "type": "rectangle" },
{ "id": 63, "name": "laptop", "type": "rectangle" },
{ "id": 64, "name": "mouse", "type": "rectangle" },
{ "id": 65, "name": "remote", "type": "rectangle" },
{ "id": 66, "name": "keyboard", "type": "rectangle" },
{ "id": 67, "name": "cell phone", "type": "rectangle" },
{ "id": 68, "name": "microwave", "type": "rectangle" },
{ "id": 69, "name": "oven", "type": "rectangle" },
{ "id": 70, "name": "toaster", "type": "rectangle" },
{ "id": 71, "name": "sink", "type": "rectangle" },
{ "id": 72, "name": "refrigerator", "type": "rectangle" },
{ "id": 73, "name": "book", "type": "rectangle" },
{ "id": 74, "name": "clock", "type": "rectangle" },
{ "id": 75, "name": "vase", "type": "rectangle" },
{ "id": 76, "name": "scissors", "type": "rectangle" },
{ "id": 77, "name": "teddy bear", "type": "rectangle" },
{ "id": 78, "name": "hair drier", "type": "rectangle" },
{ "id": 79, "name": "toothbrush", "type": "rectangle" }
]
spec:
description: YOLO v7 via onnx-runtime
runtime: 'python:3.10'
handler: main:handler
eventTimeout: 30s
build:
image: cvat.onnx.wongkinyiu.yolov7:latest-gpu
baseImage: nvidia/cuda:12.6.3-cudnn-runtime-ubuntu22.04
directives:
preCopy:
- kind: RUN
value: apt-get update && apt-get install --no-install-recommends -y wget python3-pip python-is-python3 && rm -rf /var/lib/apt/lists/*
- kind: WORKDIR
value: /opt/nuclio
- kind: RUN
value: pip install onnxruntime-gpu=='1.20.*' opencv-python-headless pillow pyyaml --no-cache-dir
- kind: WORKDIR
value: /opt/nuclio
- kind: RUN
value: wget https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-nms-640.onnx
triggers:
myHttpTrigger:
numWorkers: 1
kind: 'http'
workerAvailabilityTimeoutMilliseconds: 10000
attributes:
maxRequestBodySize: 33554432 # 32MB
resources:
limits:
nvidia.com/gpu: 1
platform:
attributes:
restartPolicy:
name: always
maximumRetryCount: 3
mountMode: volume