Files
autoanno/function-gpu.yaml
wangjialiang e0626adfb6 First
2025-11-12 17:04:47 +08:00

69 lines
2.0 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

metadata:
name: emdetector
namespace: cvat
annotations:
name: EM14 v1
type: detector
framework: pytorch
spec: |
[
{ "id": 0, "name": "EM14", "type": "rectangle" },
{ "id": 1, "name": "EM18", "type": "rectangle" },
{ "id": 2, "name": "EM17", "type": "rectangle" },
{ "id": 3, "name": "EM170", "type": "rectangle" },
{ "id": 4, "name": "EM19", "type": "rectangle" },
{ "id": 5, "name": "EM190", "type": "rectangle" },
{ "id": 6, "name": "EM20", "type": "rectangle" },
{ "id": 7, "name": "EM200", "type": "rectangle" },
{ "id": 8, "name": "EM201", "type": "rectangle" },
{ "id": 9, "name": "EM202", "type": "rectangle" },
{ "id": 10, "name": "EM203", "type": "rectangle" }
]
spec:
description: 工位检测
runtime: "python:3.9"
handler: main:handler
eventTimeout: 30s
build:
image: cvat.pth.yolo8.emdetector:latest-gpu
baseImage: python:3.9
directives:
preCopy:
- kind: ENV
value: DEBIAN_FRONTEND=noninteractive
- kind: RUN
value: apt-get update && apt-get install -y libgl1 libglib2.0-0 && apt-get clean
- kind: RUN
value: pip install ultralytics torch torchvision opencv-python-headless && pip cache purge
triggers:
myHttpTrigger:
numWorkers: 1
kind: 'http'
workerAvailabilityTimeoutMilliseconds: 10000
attributes:
# Set value from the calculation of tracking of 100 objects at the same time on a 4k image
maxRequestBodySize: 268435456 # 256MB
volumes:
- volume:
name: model-volume
hostPath:
path: /DATA/wjl/cvat/models/best.pt # 可选如果使用HostPath挂载模型
volumeMount:
name: model-volume
mountPath: /opt/nuclio/best.pt
resources:
limits:
nvidia.com/gpu: 1
platform:
attributes:
restartPolicy:
name: always
maximumRetryCount: 3
mountMode: volume