forked from cvat-ai/cvat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
function.yaml
75 lines (70 loc) · 2.26 KB
/
function.yaml
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
metadata:
name: pth.shiyinzhang.iog
namespace: cvat
annotations:
name: IOG
version: 2
type: interactor
spec:
framework: pytorch
min_pos_points: 1
min_neg_points: 0
startswith_box: true
animated_gif: https://raw.githubusercontent.com/opencv/cvat/0fbb19ae3846a017853d52e187f0ce149adced7d/site/content/en/images/iog_example.gif
help_message: The interactor allows to get a mask of an object using its wrapping boundig box, positive, and negative points inside it
spec:
description: Interactive Object Segmentation with Inside-Outside Guidance
runtime: 'python:3.9'
handler: main:handler
eventTimeout: 30s
env:
- name: PYTHONPATH
value: /opt/nuclio/iog
build:
image: cvat.pth.shiyinzhang.iog
baseImage: continuumio/miniconda3
directives:
preCopy:
- kind: WORKDIR
value: /opt/nuclio
- kind: RUN
value: conda create -y -n iog python=3.9
- kind: SHELL
value: '["conda", "run", "-n", "iog", "/bin/bash", "-c"]'
- kind: RUN
value: conda install -y -c anaconda curl
- kind: RUN
value: conda install -y pytorch torchvision -c pytorch
- kind: RUN
value: apt update && apt install -y libgl1-mesa-glx
- kind: RUN
value: conda install -y -c conda-forge pycocotools scipy
- kind: RUN
value: pip install opencv-python
- kind: RUN
value: git clone https://github.com/shiyinzhang/Inside-Outside-Guidance.git iog
- kind: WORKDIR
value: /opt/nuclio/iog
- kind: ENV
value: fileid=1Lm1hhMhhjjnNwO4Pf7SC6tXLayH2iH0l
- kind: ENV
value: filename=IOG_PASCAL_SBD.pth
- kind: RUN
value: curl -L "https://drive.google.com/uc?export=download&confirm=t&id=${fileid}" -o ${filename}
- kind: WORKDIR
value: /opt/nuclio
- kind: ENTRYPOINT
value: '["conda", "run", "-n", "iog"]'
triggers:
myHttpTrigger:
maxWorkers: 2
kind: 'http'
workerAvailabilityTimeoutMilliseconds: 10000
attributes:
maxRequestBodySize: 33554432 # 32MB
platform:
attributes:
restartPolicy:
name: always
maximumRetryCount: 3
mountMode: volume