Skip to content

Commit 220aaa8

Browse files
committed
s
1 parent c530c53 commit 220aaa8

2 files changed

Lines changed: 179 additions & 0 deletions

File tree

‎if_rest/core/converters/onnx_to_trt.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import sys
23
from typing import Union
34

@@ -111,6 +112,11 @@ def convert_onnx(input_onnx: Union[str, bytes], engine_file_path: str, force_fp1
111112

112113
assert not isinstance(engine, type(None))
113114

115+
# Ensure the target directory exists before writing the engine. Callers are
116+
# expected to create it, but guarantee it here so a fresh model build can't
117+
# fail with FileNotFoundError on a clean/bind-mounted models volume.
118+
os.makedirs(os.path.dirname(engine_file_path), exist_ok=True)
119+
114120
with open(engine_file_path, "wb") as f:
115121
if trt10:
116122
f.write(engine)

‎insightface-rest.insomnia.json‎

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
{
2+
"_type": "export",
3+
"__export_format": 4,
4+
"__export_source": "insightface-rest.manual",
5+
"resources": [
6+
{
7+
"_id": "wrk_insightface",
8+
"_type": "workspace",
9+
"parentId": null,
10+
"name": "InsightFace-REST",
11+
"description": "Face detection & recognition API (FastAPI). Routes live at the root, internal port 18081.",
12+
"scope": "collection"
13+
},
14+
{
15+
"_id": "env_base",
16+
"_type": "environment",
17+
"parentId": "wrk_insightface",
18+
"name": "Base Environment",
19+
"data": {
20+
"base_url": "https://face-detect.dokploy.moderationapi.com",
21+
"test_image": "https://github.com/SthPhoenix/InsightFace-REST/raw/master/misc/test_images/Stallone.jpg"
22+
},
23+
"dataPropertyOrder": {
24+
"&": ["base_url", "test_image"]
25+
},
26+
"metaSortKey": 1
27+
},
28+
{
29+
"_id": "fld_utility",
30+
"_type": "request_group",
31+
"parentId": "wrk_insightface",
32+
"name": "Utility",
33+
"metaSortKey": -100
34+
},
35+
{
36+
"_id": "fld_detection",
37+
"_type": "request_group",
38+
"parentId": "wrk_insightface",
39+
"name": "Detection & Recognition",
40+
"metaSortKey": -50
41+
},
42+
{
43+
"_id": "req_health",
44+
"_type": "request",
45+
"parentId": "fld_utility",
46+
"name": "Health",
47+
"method": "GET",
48+
"url": "{{ _.base_url }}/health",
49+
"body": {},
50+
"headers": [],
51+
"metaSortKey": -100
52+
},
53+
{
54+
"_id": "req_info",
55+
"_type": "request",
56+
"parentId": "fld_utility",
57+
"name": "Info (loaded models & config)",
58+
"method": "GET",
59+
"url": "{{ _.base_url }}/info",
60+
"body": {},
61+
"headers": [],
62+
"metaSortKey": -90
63+
},
64+
{
65+
"_id": "req_docs",
66+
"_type": "request",
67+
"parentId": "fld_utility",
68+
"name": "Swagger Docs",
69+
"method": "GET",
70+
"url": "{{ _.base_url }}/docs",
71+
"body": {},
72+
"headers": [],
73+
"metaSortKey": -80
74+
},
75+
{
76+
"_id": "req_extract",
77+
"_type": "request",
78+
"parentId": "fld_detection",
79+
"name": "Extract (detect + embeddings + gender/age)",
80+
"method": "POST",
81+
"url": "{{ _.base_url }}/extract",
82+
"body": {
83+
"mimeType": "application/json",
84+
"text": "{\n \"images\": {\n \"urls\": [\"{{ _.test_image }}\"]\n },\n \"threshold\": 0.6,\n \"extract_embedding\": true,\n \"extract_ga\": true,\n \"return_landmarks\": true,\n \"return_face_data\": false,\n \"limit_faces\": 0\n}"
85+
},
86+
"headers": [
87+
{
88+
"name": "Content-Type",
89+
"value": "application/json"
90+
}
91+
],
92+
"metaSortKey": -100
93+
},
94+
{
95+
"_id": "req_extract_b64",
96+
"_type": "request",
97+
"parentId": "fld_detection",
98+
"name": "Extract (base64 image data)",
99+
"method": "POST",
100+
"url": "{{ _.base_url }}/extract",
101+
"body": {
102+
"mimeType": "application/json",
103+
"text": "{\n \"images\": {\n \"data\": [\"REPLACE_WITH_BASE64_IMAGE_STRING\"]\n },\n \"threshold\": 0.6,\n \"extract_embedding\": true,\n \"extract_ga\": true\n}"
104+
},
105+
"headers": [
106+
{
107+
"name": "Content-Type",
108+
"value": "application/json"
109+
}
110+
],
111+
"metaSortKey": -90
112+
},
113+
{
114+
"_id": "req_draw",
115+
"_type": "request",
116+
"parentId": "fld_detection",
117+
"name": "Draw Detections (returns PNG)",
118+
"method": "POST",
119+
"url": "{{ _.base_url }}/draw_detections",
120+
"body": {
121+
"mimeType": "application/json",
122+
"text": "{\n \"images\": {\n \"urls\": [\"{{ _.test_image }}\"]\n },\n \"threshold\": 0.6,\n \"draw_landmarks\": true,\n \"draw_scores\": true,\n \"draw_sizes\": true,\n \"limit_faces\": 0\n}"
123+
},
124+
"headers": [
125+
{
126+
"name": "Content-Type",
127+
"value": "application/json"
128+
}
129+
],
130+
"metaSortKey": -80
131+
},
132+
{
133+
"_id": "req_draw_multipart",
134+
"_type": "request",
135+
"parentId": "fld_detection",
136+
"name": "Draw Detections (multipart file upload)",
137+
"method": "POST",
138+
"url": "{{ _.base_url }}/multipart/draw_detections",
139+
"body": {
140+
"mimeType": "multipart/form-data",
141+
"params": [
142+
{
143+
"name": "file",
144+
"type": "file",
145+
"fileName": ""
146+
},
147+
{
148+
"name": "threshold",
149+
"value": "0.6"
150+
},
151+
{
152+
"name": "draw_landmarks",
153+
"value": "true"
154+
},
155+
{
156+
"name": "draw_scores",
157+
"value": "true"
158+
},
159+
{
160+
"name": "draw_sizes",
161+
"value": "true"
162+
},
163+
{
164+
"name": "limit_faces",
165+
"value": "0"
166+
}
167+
]
168+
},
169+
"headers": [],
170+
"metaSortKey": -70
171+
}
172+
]
173+
}

0 commit comments

Comments
 (0)