@roboflow/inference-sdk 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.es.js +160 -133
- package/dist/index.js +1 -1
- package/dist/inference-api.d.ts +76 -1
- package/dist/inference-api.d.ts.map +1 -1
- package/dist/webrtc.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @roboflow/inference-sdk
|
|
2
2
|
|
|
3
|
-
Lightweight client for Roboflow's hosted inference API with WebRTC streaming support for real-time computer vision in the browser.
|
|
3
|
+
Lightweight JS client for Roboflow's hosted inference API with WebRTC streaming support for real-time computer vision in the browser.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
package/dist/index.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var u = (
|
|
4
|
-
class
|
|
1
|
+
var T = Object.defineProperty;
|
|
2
|
+
var O = (a, e, t) => e in a ? T(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
|
|
3
|
+
var u = (a, e, t) => O(a, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
class _ {
|
|
5
5
|
/**
|
|
6
6
|
* @private
|
|
7
7
|
* Use InferenceHTTPClient.init() instead
|
|
@@ -14,7 +14,7 @@ class g {
|
|
|
14
14
|
static init({ apiKey: e, serverUrl: t }) {
|
|
15
15
|
if (!e)
|
|
16
16
|
throw new Error("apiKey is required");
|
|
17
|
-
return new
|
|
17
|
+
return new _(e, t);
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* Initialize a WebRTC worker pipeline
|
|
@@ -44,51 +44,59 @@ class g {
|
|
|
44
44
|
async initializeWebrtcWorker({
|
|
45
45
|
offer: e,
|
|
46
46
|
workflowSpec: t,
|
|
47
|
-
workspaceName:
|
|
47
|
+
workspaceName: n,
|
|
48
48
|
workflowId: r,
|
|
49
49
|
config: o = {}
|
|
50
50
|
}) {
|
|
51
51
|
if (!e || !e.sdp || !e.type)
|
|
52
52
|
throw new Error("offer with sdp and type is required");
|
|
53
|
-
const i = !!t,
|
|
54
|
-
if (!i && !
|
|
53
|
+
const i = !!t, s = !!(n && r);
|
|
54
|
+
if (!i && !s)
|
|
55
55
|
throw new Error("Either workflowSpec OR (workspaceName + workflowId) is required");
|
|
56
|
-
if (i &&
|
|
56
|
+
if (i && s)
|
|
57
57
|
throw new Error("Provide either workflowSpec OR (workspaceName + workflowId), not both");
|
|
58
58
|
const {
|
|
59
59
|
imageInputName: d = "image",
|
|
60
|
-
streamOutputNames:
|
|
61
|
-
dataOutputNames:
|
|
62
|
-
threadPoolWorkers: p = 4
|
|
63
|
-
|
|
60
|
+
streamOutputNames: c = [],
|
|
61
|
+
dataOutputNames: l = ["string"],
|
|
62
|
+
threadPoolWorkers: p = 4,
|
|
63
|
+
workflowsParameters: y = {},
|
|
64
|
+
iceServers: w,
|
|
65
|
+
processingTimeout: k,
|
|
66
|
+
requestedPlan: S,
|
|
67
|
+
requestedRegion: f
|
|
68
|
+
} = o, g = {
|
|
64
69
|
type: "WorkflowConfiguration",
|
|
65
70
|
image_input_name: d,
|
|
71
|
+
workflows_parameters: y,
|
|
66
72
|
workflows_thread_pool_workers: p,
|
|
67
73
|
cancel_thread_pool_tasks_on_exit: !0,
|
|
68
74
|
video_metadata_input_name: "video_metadata"
|
|
69
75
|
};
|
|
70
|
-
i ?
|
|
71
|
-
const
|
|
72
|
-
workflow_configuration:
|
|
76
|
+
i ? g.workflow_specification = t : (g.workspace_name = n, g.workflow_id = r);
|
|
77
|
+
const m = {
|
|
78
|
+
workflow_configuration: g,
|
|
73
79
|
api_key: this.apiKey,
|
|
74
80
|
webrtc_realtime_processing: !0,
|
|
75
81
|
webrtc_offer: {
|
|
76
82
|
sdp: e.sdp,
|
|
77
83
|
type: e.type
|
|
78
84
|
},
|
|
79
|
-
|
|
80
|
-
stream_output:
|
|
81
|
-
data_output:
|
|
82
|
-
}
|
|
85
|
+
webrtc_config: w ? { iceServers: w } : null,
|
|
86
|
+
stream_output: c,
|
|
87
|
+
data_output: l
|
|
88
|
+
};
|
|
89
|
+
k !== void 0 && (m.processing_timeout = k), S !== void 0 && (m.requested_plan = S), f !== void 0 && (m.requested_region = f), console.trace("payload", m);
|
|
90
|
+
const h = await fetch(`${this.serverUrl}/initialise_webrtc_worker`, {
|
|
83
91
|
method: "POST",
|
|
84
92
|
headers: { "Content-Type": "application/json" },
|
|
85
|
-
body: JSON.stringify(
|
|
93
|
+
body: JSON.stringify(m)
|
|
86
94
|
});
|
|
87
|
-
if (!
|
|
88
|
-
const
|
|
89
|
-
throw new Error(`initialise_webrtc_worker failed (${
|
|
95
|
+
if (!h.ok) {
|
|
96
|
+
const E = await h.text().catch(() => "");
|
|
97
|
+
throw new Error(`initialise_webrtc_worker failed (${h.status}): ${E}`);
|
|
90
98
|
}
|
|
91
|
-
return await
|
|
99
|
+
return await h.json();
|
|
92
100
|
}
|
|
93
101
|
async terminatePipeline({ pipelineId: e }) {
|
|
94
102
|
if (!e)
|
|
@@ -102,7 +110,7 @@ class g {
|
|
|
102
110
|
);
|
|
103
111
|
}
|
|
104
112
|
}
|
|
105
|
-
const
|
|
113
|
+
const K = {
|
|
106
114
|
/**
|
|
107
115
|
* Create a connector that uses API key directly
|
|
108
116
|
*
|
|
@@ -121,25 +129,33 @@ const U = {
|
|
|
121
129
|
* const answer = await connector.connectWrtc(offer, wrtcParams);
|
|
122
130
|
* ```
|
|
123
131
|
*/
|
|
124
|
-
withApiKey(
|
|
132
|
+
withApiKey(a, e = {}) {
|
|
125
133
|
const { serverUrl: t } = e;
|
|
126
134
|
return typeof window < "u" && console.warn(
|
|
127
135
|
"[Security Warning] Using API key directly in browser will expose it. Use connectors.withProxyUrl() for production. See: https://docs.roboflow.com/api-reference/authentication#securing-your-api-key"
|
|
128
136
|
), {
|
|
129
|
-
connectWrtc: async (
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
137
|
+
connectWrtc: async (n, r) => {
|
|
138
|
+
const o = _.init({ apiKey: a, serverUrl: t });
|
|
139
|
+
return console.log("wrtcParams", r), await o.initializeWebrtcWorker({
|
|
140
|
+
offer: n,
|
|
141
|
+
workflowSpec: r.workflowSpec,
|
|
142
|
+
workspaceName: r.workspaceName,
|
|
143
|
+
workflowId: r.workflowId,
|
|
144
|
+
config: {
|
|
145
|
+
imageInputName: r.imageInputName,
|
|
146
|
+
streamOutputNames: r.streamOutputNames,
|
|
147
|
+
dataOutputNames: r.dataOutputNames,
|
|
148
|
+
threadPoolWorkers: r.threadPoolWorkers,
|
|
149
|
+
workflowsParameters: r.workflowsParameters,
|
|
150
|
+
iceServers: r.iceServers,
|
|
151
|
+
processingTimeout: r.processingTimeout,
|
|
152
|
+
requestedPlan: r.requestedPlan,
|
|
153
|
+
requestedRegion: r.requestedRegion
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
},
|
|
141
157
|
// Store apiKey for cleanup
|
|
142
|
-
_apiKey:
|
|
158
|
+
_apiKey: a,
|
|
143
159
|
_serverUrl: t
|
|
144
160
|
};
|
|
145
161
|
},
|
|
@@ -176,22 +192,27 @@ const U = {
|
|
|
176
192
|
* imageInputName: wrtcParams.imageInputName,
|
|
177
193
|
* streamOutputNames: wrtcParams.streamOutputNames,
|
|
178
194
|
* dataOutputNames: wrtcParams.dataOutputNames,
|
|
179
|
-
* threadPoolWorkers: wrtcParams.threadPoolWorkers
|
|
195
|
+
* threadPoolWorkers: wrtcParams.threadPoolWorkers,
|
|
196
|
+
* workflowsParameters: wrtcParams.workflowsParameters,
|
|
197
|
+
* iceServers: wrtcParams.iceServers,
|
|
198
|
+
* processingTimeout: wrtcParams.processingTimeout,
|
|
199
|
+
* requestedPlan: wrtcParams.requestedPlan,
|
|
200
|
+
* requestedRegion: wrtcParams.requestedRegion
|
|
180
201
|
* }
|
|
181
202
|
* });
|
|
182
203
|
* res.json(answer);
|
|
183
204
|
* });
|
|
184
205
|
* ```
|
|
185
206
|
*/
|
|
186
|
-
withProxyUrl(
|
|
207
|
+
withProxyUrl(a, e = {}) {
|
|
187
208
|
return {
|
|
188
|
-
connectWrtc: async (t,
|
|
189
|
-
const r = await fetch(
|
|
209
|
+
connectWrtc: async (t, n) => {
|
|
210
|
+
const r = await fetch(a, {
|
|
190
211
|
method: "POST",
|
|
191
212
|
headers: { "Content-Type": "application/json" },
|
|
192
213
|
body: JSON.stringify({
|
|
193
214
|
offer: t,
|
|
194
|
-
wrtcParams:
|
|
215
|
+
wrtcParams: n
|
|
195
216
|
})
|
|
196
217
|
});
|
|
197
218
|
if (!r.ok) {
|
|
@@ -203,25 +224,25 @@ const U = {
|
|
|
203
224
|
};
|
|
204
225
|
}
|
|
205
226
|
};
|
|
206
|
-
async function
|
|
227
|
+
async function W(a = { video: !0 }) {
|
|
207
228
|
try {
|
|
208
|
-
console.log("[RFStreams] requesting with",
|
|
209
|
-
const e = await navigator.mediaDevices.getUserMedia(
|
|
229
|
+
console.log("[RFStreams] requesting with", a);
|
|
230
|
+
const e = await navigator.mediaDevices.getUserMedia(a);
|
|
210
231
|
return console.log("[RFStreams] got stream", e.getVideoTracks().map((t) => ({ id: t.id, label: t.label }))), e;
|
|
211
232
|
} catch (e) {
|
|
212
233
|
console.warn("[RFStreams] failed, falling back", e);
|
|
213
234
|
const t = await navigator.mediaDevices.getUserMedia({ video: !0, audio: !1 });
|
|
214
|
-
return console.log("[RFStreams] fallback stream", t.getVideoTracks().map((
|
|
235
|
+
return console.log("[RFStreams] fallback stream", t.getVideoTracks().map((n) => ({ id: n.id, label: n.label }))), t;
|
|
215
236
|
}
|
|
216
237
|
}
|
|
217
|
-
function
|
|
218
|
-
|
|
238
|
+
function v(a) {
|
|
239
|
+
a && (a.getTracks().forEach((e) => e.stop()), console.log("[RFStreams] Stream stopped"));
|
|
219
240
|
}
|
|
220
|
-
const
|
|
241
|
+
const j = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
221
242
|
__proto__: null,
|
|
222
|
-
stopStream:
|
|
223
|
-
useCamera:
|
|
224
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
243
|
+
stopStream: v,
|
|
244
|
+
useCamera: W
|
|
245
|
+
}, Symbol.toStringTag, { value: "Module" })), F = 12;
|
|
225
246
|
class b {
|
|
226
247
|
constructor() {
|
|
227
248
|
u(this, "pendingFrames", /* @__PURE__ */ new Map());
|
|
@@ -229,22 +250,22 @@ class b {
|
|
|
229
250
|
/**
|
|
230
251
|
* Process an incoming chunk and return the complete message if all chunks received
|
|
231
252
|
*/
|
|
232
|
-
processChunk(e, t,
|
|
233
|
-
if (
|
|
253
|
+
processChunk(e, t, n, r) {
|
|
254
|
+
if (n === 1)
|
|
234
255
|
return r;
|
|
235
256
|
this.pendingFrames.has(e) || this.pendingFrames.set(e, {
|
|
236
257
|
chunks: /* @__PURE__ */ new Map(),
|
|
237
|
-
totalChunks:
|
|
258
|
+
totalChunks: n
|
|
238
259
|
});
|
|
239
260
|
const o = this.pendingFrames.get(e);
|
|
240
|
-
if (o.chunks.set(t, r), o.chunks.size ===
|
|
241
|
-
const i = Array.from(o.chunks.values()).reduce((
|
|
261
|
+
if (o.chunks.set(t, r), o.chunks.size === n) {
|
|
262
|
+
const i = Array.from(o.chunks.values()).reduce((c, l) => c + l.length, 0), s = new Uint8Array(i);
|
|
242
263
|
let d = 0;
|
|
243
|
-
for (let
|
|
244
|
-
const
|
|
245
|
-
|
|
264
|
+
for (let c = 0; c < n; c++) {
|
|
265
|
+
const l = o.chunks.get(c);
|
|
266
|
+
s.set(l, d), d += l.length;
|
|
246
267
|
}
|
|
247
|
-
return this.pendingFrames.delete(e),
|
|
268
|
+
return this.pendingFrames.delete(e), s;
|
|
248
269
|
}
|
|
249
270
|
return null;
|
|
250
271
|
}
|
|
@@ -255,24 +276,24 @@ class b {
|
|
|
255
276
|
this.pendingFrames.clear();
|
|
256
277
|
}
|
|
257
278
|
}
|
|
258
|
-
function
|
|
259
|
-
const e = new DataView(
|
|
260
|
-
return { frameId: t, chunkIndex:
|
|
279
|
+
function C(a) {
|
|
280
|
+
const e = new DataView(a), t = e.getUint32(0, !0), n = e.getUint32(4, !0), r = e.getUint32(8, !0), o = new Uint8Array(a, F);
|
|
281
|
+
return { frameId: t, chunkIndex: n, totalChunks: r, payload: o };
|
|
261
282
|
}
|
|
262
|
-
async function P(
|
|
263
|
-
if (
|
|
283
|
+
async function P(a, e = 6e3) {
|
|
284
|
+
if (a.iceGatheringState === "complete") return;
|
|
264
285
|
let t = !1;
|
|
265
|
-
const
|
|
286
|
+
const n = (r) => {
|
|
266
287
|
r.candidate && r.candidate.type === "srflx" && (t = !0);
|
|
267
288
|
};
|
|
268
|
-
|
|
289
|
+
a.addEventListener("icecandidate", n);
|
|
269
290
|
try {
|
|
270
291
|
await Promise.race([
|
|
271
292
|
new Promise((r) => {
|
|
272
293
|
const o = () => {
|
|
273
|
-
|
|
294
|
+
a.iceGatheringState === "complete" && (a.removeEventListener("icegatheringstatechange", o), r());
|
|
274
295
|
};
|
|
275
|
-
|
|
296
|
+
a.addEventListener("icegatheringstatechange", o);
|
|
276
297
|
}),
|
|
277
298
|
new Promise((r, o) => {
|
|
278
299
|
setTimeout(() => {
|
|
@@ -281,56 +302,59 @@ async function P(n, e = 6e3) {
|
|
|
281
302
|
})
|
|
282
303
|
]);
|
|
283
304
|
} finally {
|
|
284
|
-
|
|
305
|
+
a.removeEventListener("icecandidate", n);
|
|
285
306
|
}
|
|
286
307
|
}
|
|
287
|
-
function
|
|
308
|
+
function I(a) {
|
|
288
309
|
return new Promise((e) => {
|
|
289
|
-
|
|
310
|
+
a.addEventListener("track", (t) => {
|
|
290
311
|
t.streams && t.streams[0] && e(t.streams[0]);
|
|
291
312
|
});
|
|
292
313
|
});
|
|
293
314
|
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
315
|
+
const D = [
|
|
316
|
+
{ urls: ["stun:stun.l.google.com:19302"] }
|
|
317
|
+
];
|
|
318
|
+
async function x(a, e) {
|
|
319
|
+
const t = e ?? D, n = new RTCPeerConnection({
|
|
320
|
+
iceServers: t
|
|
297
321
|
});
|
|
298
322
|
try {
|
|
299
|
-
|
|
300
|
-
} catch (
|
|
301
|
-
console.warn("[RFWebRTC] Could not add transceiver:",
|
|
323
|
+
n.addTransceiver("video", { direction: "recvonly" });
|
|
324
|
+
} catch (s) {
|
|
325
|
+
console.warn("[RFWebRTC] Could not add transceiver:", s);
|
|
302
326
|
}
|
|
303
|
-
|
|
327
|
+
a.getVideoTracks().forEach((s) => {
|
|
304
328
|
try {
|
|
305
|
-
|
|
329
|
+
s.contentHint = "detail";
|
|
306
330
|
} catch {
|
|
307
331
|
}
|
|
308
|
-
|
|
332
|
+
n.addTrack(s, a);
|
|
309
333
|
});
|
|
310
|
-
const
|
|
334
|
+
const r = I(n), o = n.createDataChannel("roboflow-control", {
|
|
311
335
|
ordered: !0
|
|
312
|
-
}),
|
|
313
|
-
return await
|
|
314
|
-
pc:
|
|
315
|
-
offer:
|
|
316
|
-
remoteStreamPromise:
|
|
317
|
-
dataChannel:
|
|
336
|
+
}), i = await n.createOffer();
|
|
337
|
+
return await n.setLocalDescription(i), await P(n), {
|
|
338
|
+
pc: n,
|
|
339
|
+
offer: n.localDescription,
|
|
340
|
+
remoteStreamPromise: r,
|
|
341
|
+
dataChannel: o
|
|
318
342
|
};
|
|
319
343
|
}
|
|
320
|
-
async function
|
|
321
|
-
const e =
|
|
344
|
+
async function N(a) {
|
|
345
|
+
const e = a.getSenders().find((n) => n.track && n.track.kind === "video");
|
|
322
346
|
if (!e) return;
|
|
323
347
|
const t = e.getParameters();
|
|
324
348
|
t.encodings = t.encodings || [{}], t.encodings[0].scaleResolutionDownBy = 1;
|
|
325
349
|
try {
|
|
326
350
|
await e.setParameters(t);
|
|
327
|
-
} catch (
|
|
328
|
-
console.warn("[RFWebRTC] Failed to set encoding parameters:",
|
|
351
|
+
} catch (n) {
|
|
352
|
+
console.warn("[RFWebRTC] Failed to set encoding parameters:", n);
|
|
329
353
|
}
|
|
330
354
|
}
|
|
331
|
-
class
|
|
355
|
+
class R {
|
|
332
356
|
/** @private */
|
|
333
|
-
constructor(e, t,
|
|
357
|
+
constructor(e, t, n, r, o, i, s) {
|
|
334
358
|
u(this, "pc");
|
|
335
359
|
u(this, "_localStream");
|
|
336
360
|
u(this, "remoteStreamPromise");
|
|
@@ -338,21 +362,21 @@ class C {
|
|
|
338
362
|
u(this, "apiKey");
|
|
339
363
|
u(this, "dataChannel");
|
|
340
364
|
u(this, "reassembler");
|
|
341
|
-
this.pc = e, this._localStream = t, this.remoteStreamPromise =
|
|
365
|
+
this.pc = e, this._localStream = t, this.remoteStreamPromise = n, this.pipelineId = r, this.apiKey = o, this.dataChannel = i, this.reassembler = new b(), this.dataChannel.binaryType = "arraybuffer", s && (this.dataChannel.addEventListener("open", () => {
|
|
342
366
|
}), this.dataChannel.addEventListener("message", (d) => {
|
|
343
367
|
try {
|
|
344
368
|
if (d.data instanceof ArrayBuffer) {
|
|
345
|
-
const { frameId:
|
|
346
|
-
if (
|
|
347
|
-
const
|
|
348
|
-
|
|
369
|
+
const { frameId: c, chunkIndex: l, totalChunks: p, payload: y } = C(d.data), w = this.reassembler.processChunk(c, l, p, y);
|
|
370
|
+
if (w) {
|
|
371
|
+
const S = new TextDecoder("utf-8").decode(w), f = JSON.parse(S);
|
|
372
|
+
s(f);
|
|
349
373
|
}
|
|
350
374
|
} else {
|
|
351
|
-
const
|
|
352
|
-
|
|
375
|
+
const c = JSON.parse(d.data);
|
|
376
|
+
s(c);
|
|
353
377
|
}
|
|
354
|
-
} catch (
|
|
355
|
-
console.error("[RFWebRTC] Failed to parse data channel message:",
|
|
378
|
+
} catch (c) {
|
|
379
|
+
console.error("[RFWebRTC] Failed to parse data channel message:", c);
|
|
356
380
|
}
|
|
357
381
|
}), this.dataChannel.addEventListener("error", (d) => {
|
|
358
382
|
console.error("[RFWebRTC] Data channel error:", d);
|
|
@@ -406,7 +430,7 @@ class C {
|
|
|
406
430
|
* ```
|
|
407
431
|
*/
|
|
408
432
|
async cleanup() {
|
|
409
|
-
this.reassembler.clear(), this.pipelineId && this.apiKey && await
|
|
433
|
+
this.reassembler.clear(), this.pipelineId && this.apiKey && await _.init({ apiKey: this.apiKey }).terminatePipeline({ pipelineId: this.pipelineId }), this.pc && this.pc.connectionState !== "closed" && this.pc.close(), v(this._localStream);
|
|
410
434
|
}
|
|
411
435
|
/**
|
|
412
436
|
* Reconfigure pipeline outputs at runtime
|
|
@@ -461,44 +485,47 @@ class C {
|
|
|
461
485
|
}
|
|
462
486
|
}
|
|
463
487
|
}
|
|
464
|
-
async function
|
|
465
|
-
source:
|
|
488
|
+
async function U({
|
|
489
|
+
source: a,
|
|
466
490
|
connector: e,
|
|
467
491
|
wrtcParams: t,
|
|
468
|
-
onData:
|
|
492
|
+
onData: n,
|
|
469
493
|
options: r = {}
|
|
470
494
|
}) {
|
|
471
|
-
var
|
|
495
|
+
var f;
|
|
472
496
|
if (!e || typeof e.connectWrtc != "function")
|
|
473
497
|
throw new Error("connector must have a connectWrtc method");
|
|
474
|
-
const o =
|
|
475
|
-
|
|
498
|
+
const o = a, { pc: i, offer: s, remoteStreamPromise: d, dataChannel: c } = await x(
|
|
499
|
+
o,
|
|
500
|
+
t.iceServers
|
|
501
|
+
), l = await e.connectWrtc(
|
|
502
|
+
{ sdp: s.sdp, type: s.type },
|
|
476
503
|
t
|
|
477
|
-
), p = { sdp:
|
|
504
|
+
), p = { sdp: l.sdp, type: l.type };
|
|
478
505
|
if (!(p != null && p.sdp) || !(p != null && p.type))
|
|
479
|
-
throw console.error("[RFWebRTC] Invalid answer from server:",
|
|
480
|
-
const
|
|
481
|
-
await i.setRemoteDescription(p), await new Promise((
|
|
482
|
-
const
|
|
483
|
-
i.connectionState === "connected" ? (i.removeEventListener("connectionstatechange",
|
|
506
|
+
throw console.error("[RFWebRTC] Invalid answer from server:", l), new Error("connector.connectWrtc must return answer with sdp and type");
|
|
507
|
+
const y = ((f = l == null ? void 0 : l.context) == null ? void 0 : f.pipeline_id) || null;
|
|
508
|
+
await i.setRemoteDescription(p), await new Promise((g, m) => {
|
|
509
|
+
const h = () => {
|
|
510
|
+
i.connectionState === "connected" ? (i.removeEventListener("connectionstatechange", h), g()) : i.connectionState === "failed" && (i.removeEventListener("connectionstatechange", h), m(new Error("WebRTC connection failed")));
|
|
484
511
|
};
|
|
485
|
-
i.addEventListener("connectionstatechange",
|
|
486
|
-
i.removeEventListener("connectionstatechange",
|
|
512
|
+
i.addEventListener("connectionstatechange", h), h(), setTimeout(() => {
|
|
513
|
+
i.removeEventListener("connectionstatechange", h), m(new Error("WebRTC connection timeout after 30s"));
|
|
487
514
|
}, 3e4);
|
|
488
|
-
}), r.disableInputStreamDownscaling !== !1 && await
|
|
489
|
-
const
|
|
490
|
-
return new
|
|
515
|
+
}), r.disableInputStreamDownscaling !== !1 && await N(i);
|
|
516
|
+
const k = e._apiKey || null;
|
|
517
|
+
return new R(i, o, d, y, k, c, n);
|
|
491
518
|
}
|
|
492
|
-
const
|
|
519
|
+
const $ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
493
520
|
__proto__: null,
|
|
494
521
|
ChunkReassembler: b,
|
|
495
|
-
RFWebRTCConnection:
|
|
496
|
-
parseBinaryHeader:
|
|
497
|
-
useStream:
|
|
522
|
+
RFWebRTCConnection: R,
|
|
523
|
+
parseBinaryHeader: C,
|
|
524
|
+
useStream: U
|
|
498
525
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
499
526
|
export {
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
527
|
+
_ as InferenceHTTPClient,
|
|
528
|
+
K as connectors,
|
|
529
|
+
j as streams,
|
|
530
|
+
$ as webrtc
|
|
504
531
|
};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(l,s){typeof exports=="object"&&typeof module<"u"?s(exports):typeof define=="function"&&define.amd?define(["exports"],s):(l=typeof globalThis<"u"?globalThis:l||self,s(l.RoboflowClient={}))})(this,function(l){"use strict";var K=Object.defineProperty;var j=(l,s,y)=>s in l?K(l,s,{enumerable:!0,configurable:!0,writable:!0,value:y}):l[s]=y;var f=(l,s,y)=>j(l,typeof s!="symbol"?s+"":s,y);class s{constructor(e,t="https://serverless.roboflow.com"){f(this,"apiKey");f(this,"serverUrl");this.apiKey=e,this.serverUrl=t}static init({apiKey:e,serverUrl:t}){if(!e)throw new Error("apiKey is required");return new s(e,t)}async initializeWebrtcWorker({offer:e,workflowSpec:t,workspaceName:r,workflowId:n,config:a={}}){if(!e||!e.sdp||!e.type)throw new Error("offer with sdp and type is required");const i=!!t,c=!!(r&&n);if(!i&&!c)throw new Error("Either workflowSpec OR (workspaceName + workflowId) is required");if(i&&c)throw new Error("Provide either workflowSpec OR (workspaceName + workflowId), not both");const{imageInputName:p="image",streamOutputNames:d=[],dataOutputNames:u=["string"],threadPoolWorkers:h=4,workflowsParameters:_={},iceServers:S,processingTimeout:b,requestedPlan:v,requestedRegion:g}=a,k={type:"WorkflowConfiguration",image_input_name:p,workflows_parameters:_,workflows_thread_pool_workers:h,cancel_thread_pool_tasks_on_exit:!0,video_metadata_input_name:"video_metadata"};i?k.workflow_specification=t:(k.workspace_name=r,k.workflow_id=n);const w={workflow_configuration:k,api_key:this.apiKey,webrtc_realtime_processing:!0,webrtc_offer:{sdp:e.sdp,type:e.type},webrtc_config:S?{iceServers:S}:null,stream_output:d,data_output:u};b!==void 0&&(w.processing_timeout=b),v!==void 0&&(w.requested_plan=v),g!==void 0&&(w.requested_region=g),console.trace("payload",w);const m=await fetch(`${this.serverUrl}/initialise_webrtc_worker`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(w)});if(!m.ok){const q=await m.text().catch(()=>"");throw new Error(`initialise_webrtc_worker failed (${m.status}): ${q}`)}return await m.json()}async terminatePipeline({pipelineId:e}){if(!e)throw new Error("pipelineId is required");await fetch(`${this.serverUrl}/inference_pipelines/${e}/terminate?api_key=${this.apiKey}`,{method:"POST",headers:{"Content-Type":"application/json"}})}}const y={withApiKey(o,e={}){const{serverUrl:t}=e;return typeof window<"u"&&console.warn("[Security Warning] Using API key directly in browser will expose it. Use connectors.withProxyUrl() for production. See: https://docs.roboflow.com/api-reference/authentication#securing-your-api-key"),{connectWrtc:async(r,n)=>{const a=s.init({apiKey:o,serverUrl:t});return console.log("wrtcParams",n),await a.initializeWebrtcWorker({offer:r,workflowSpec:n.workflowSpec,workspaceName:n.workspaceName,workflowId:n.workflowId,config:{imageInputName:n.imageInputName,streamOutputNames:n.streamOutputNames,dataOutputNames:n.dataOutputNames,threadPoolWorkers:n.threadPoolWorkers,workflowsParameters:n.workflowsParameters,iceServers:n.iceServers,processingTimeout:n.processingTimeout,requestedPlan:n.requestedPlan,requestedRegion:n.requestedRegion}})},_apiKey:o,_serverUrl:t}},withProxyUrl(o,e={}){return{connectWrtc:async(t,r)=>{const n=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({offer:t,wrtcParams:r})});if(!n.ok){const a=await n.text().catch(()=>"");throw new Error(`Proxy request failed (${n.status}): ${a}`)}return await n.json()}}}};async function O(o={video:!0}){try{console.log("[RFStreams] requesting with",o);const e=await navigator.mediaDevices.getUserMedia(o);return console.log("[RFStreams] got stream",e.getVideoTracks().map(t=>({id:t.id,label:t.label}))),e}catch(e){console.warn("[RFStreams] failed, falling back",e);const t=await navigator.mediaDevices.getUserMedia({video:!0,audio:!1});return console.log("[RFStreams] fallback stream",t.getVideoTracks().map(r=>({id:r.id,label:r.label}))),t}}function C(o){o&&(o.getTracks().forEach(e=>e.stop()),console.log("[RFStreams] Stream stopped"))}const W=Object.freeze(Object.defineProperty({__proto__:null,stopStream:C,useCamera:O},Symbol.toStringTag,{value:"Module"})),P=12;class T{constructor(){f(this,"pendingFrames",new Map)}processChunk(e,t,r,n){if(r===1)return n;this.pendingFrames.has(e)||this.pendingFrames.set(e,{chunks:new Map,totalChunks:r});const a=this.pendingFrames.get(e);if(a.chunks.set(t,n),a.chunks.size===r){const i=Array.from(a.chunks.values()).reduce((d,u)=>d+u.length,0),c=new Uint8Array(i);let p=0;for(let d=0;d<r;d++){const u=a.chunks.get(d);c.set(u,p),p+=u.length}return this.pendingFrames.delete(e),c}return null}clear(){this.pendingFrames.clear()}}function R(o){const e=new DataView(o),t=e.getUint32(0,!0),r=e.getUint32(4,!0),n=e.getUint32(8,!0),a=new Uint8Array(o,P);return{frameId:t,chunkIndex:r,totalChunks:n,payload:a}}async function F(o,e=6e3){if(o.iceGatheringState==="complete")return;let t=!1;const r=n=>{n.candidate&&n.candidate.type==="srflx"&&(t=!0)};o.addEventListener("icecandidate",r);try{await Promise.race([new Promise(n=>{const a=()=>{o.iceGatheringState==="complete"&&(o.removeEventListener("icegatheringstatechange",a),n())};o.addEventListener("icegatheringstatechange",a)}),new Promise((n,a)=>{setTimeout(()=>{t?n():(console.error("[ICE] timeout with NO srflx candidate! Connection may fail."),a(new Error("ICE gathering timeout without srflx candidate")))},e)})])}finally{o.removeEventListener("icecandidate",r)}}function I(o){return new Promise(e=>{o.addEventListener("track",t=>{t.streams&&t.streams[0]&&e(t.streams[0])})})}const D=[{urls:["stun:stun.l.google.com:19302"]}];async function N(o,e){const t=e??D,r=new RTCPeerConnection({iceServers:t});try{r.addTransceiver("video",{direction:"recvonly"})}catch(c){console.warn("[RFWebRTC] Could not add transceiver:",c)}o.getVideoTracks().forEach(c=>{try{c.contentHint="detail"}catch{}r.addTrack(c,o)});const n=I(r),a=r.createDataChannel("roboflow-control",{ordered:!0}),i=await r.createOffer();return await r.setLocalDescription(i),await F(r),{pc:r,offer:r.localDescription,remoteStreamPromise:n,dataChannel:a}}async function U(o){const e=o.getSenders().find(r=>r.track&&r.track.kind==="video");if(!e)return;const t=e.getParameters();t.encodings=t.encodings||[{}],t.encodings[0].scaleResolutionDownBy=1;try{await e.setParameters(t)}catch(r){console.warn("[RFWebRTC] Failed to set encoding parameters:",r)}}class E{constructor(e,t,r,n,a,i,c){f(this,"pc");f(this,"_localStream");f(this,"remoteStreamPromise");f(this,"pipelineId");f(this,"apiKey");f(this,"dataChannel");f(this,"reassembler");this.pc=e,this._localStream=t,this.remoteStreamPromise=r,this.pipelineId=n,this.apiKey=a,this.dataChannel=i,this.reassembler=new T,this.dataChannel.binaryType="arraybuffer",c&&(this.dataChannel.addEventListener("open",()=>{}),this.dataChannel.addEventListener("message",p=>{try{if(p.data instanceof ArrayBuffer){const{frameId:d,chunkIndex:u,totalChunks:h,payload:_}=R(p.data),S=this.reassembler.processChunk(d,u,h,_);if(S){const v=new TextDecoder("utf-8").decode(S),g=JSON.parse(v);c(g)}}else{const d=JSON.parse(p.data);c(d)}}catch(d){console.error("[RFWebRTC] Failed to parse data channel message:",d)}}),this.dataChannel.addEventListener("error",p=>{console.error("[RFWebRTC] Data channel error:",p)}),this.dataChannel.addEventListener("close",()=>{this.reassembler.clear()}))}async remoteStream(){return await this.remoteStreamPromise}localStream(){return this._localStream}async cleanup(){this.reassembler.clear(),this.pipelineId&&this.apiKey&&await s.init({apiKey:this.apiKey}).terminatePipeline({pipelineId:this.pipelineId}),this.pc&&this.pc.connectionState!=="closed"&&this.pc.close(),C(this._localStream)}reconfigureOutputs(e){const t={};e.streamOutput!==void 0&&(t.stream_output=e.streamOutput),e.dataOutput!==void 0&&(t.data_output=e.dataOutput),this.sendData(t)}sendData(e){if(this.dataChannel.readyState!=="open"){console.warn("[RFWebRTC] Data channel is not open. Current state:",this.dataChannel.readyState);return}try{const t=typeof e=="string"?e:JSON.stringify(e);this.dataChannel.send(t)}catch(t){console.error("[RFWebRTC] Failed to send data:",t)}}}async function L({source:o,connector:e,wrtcParams:t,onData:r,options:n={}}){var g;if(!e||typeof e.connectWrtc!="function")throw new Error("connector must have a connectWrtc method");const a=o,{pc:i,offer:c,remoteStreamPromise:p,dataChannel:d}=await N(a,t.iceServers),u=await e.connectWrtc({sdp:c.sdp,type:c.type},t),h={sdp:u.sdp,type:u.type};if(!(h!=null&&h.sdp)||!(h!=null&&h.type))throw console.error("[RFWebRTC] Invalid answer from server:",u),new Error("connector.connectWrtc must return answer with sdp and type");const _=((g=u==null?void 0:u.context)==null?void 0:g.pipeline_id)||null;await i.setRemoteDescription(h),await new Promise((k,w)=>{const m=()=>{i.connectionState==="connected"?(i.removeEventListener("connectionstatechange",m),k()):i.connectionState==="failed"&&(i.removeEventListener("connectionstatechange",m),w(new Error("WebRTC connection failed")))};i.addEventListener("connectionstatechange",m),m(),setTimeout(()=>{i.removeEventListener("connectionstatechange",m),w(new Error("WebRTC connection timeout after 30s"))},3e4)}),n.disableInputStreamDownscaling!==!1&&await U(i);const b=e._apiKey||null;return new E(i,a,p,_,b,d,r)}const x=Object.freeze(Object.defineProperty({__proto__:null,ChunkReassembler:T,RFWebRTCConnection:E,parseBinaryHeader:R,useStream:L},Symbol.toStringTag,{value:"Module"}));l.InferenceHTTPClient=s,l.connectors=y,l.streams=W,l.webrtc=x,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
|
package/dist/inference-api.d.ts
CHANGED
|
@@ -3,6 +3,40 @@ export interface WebRTCWorkerConfig {
|
|
|
3
3
|
streamOutputNames?: string[];
|
|
4
4
|
dataOutputNames?: string[];
|
|
5
5
|
threadPoolWorkers?: number;
|
|
6
|
+
/**
|
|
7
|
+
* Workflow parameters to pass to the workflow execution
|
|
8
|
+
*/
|
|
9
|
+
workflowsParameters?: Record<string, any>;
|
|
10
|
+
/**
|
|
11
|
+
* ICE servers for WebRTC connections (used for both client and server)
|
|
12
|
+
*/
|
|
13
|
+
iceServers?: RTCIceServerConfig[];
|
|
14
|
+
/**
|
|
15
|
+
* Processing timeout in seconds (serverless only)
|
|
16
|
+
* @default 600
|
|
17
|
+
*/
|
|
18
|
+
processingTimeout?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Requested compute plan (serverless only)
|
|
21
|
+
* @example "webrtc-gpu-small"
|
|
22
|
+
*/
|
|
23
|
+
requestedPlan?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Requested region for processing (serverless only)
|
|
26
|
+
* @example "us"
|
|
27
|
+
*/
|
|
28
|
+
requestedRegion?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* ICE server configuration for WebRTC connections
|
|
32
|
+
*
|
|
33
|
+
* Use this to configure custom STUN/TURN servers for users behind
|
|
34
|
+
* symmetric NAT or restrictive firewalls.
|
|
35
|
+
*/
|
|
36
|
+
export interface RTCIceServerConfig {
|
|
37
|
+
urls: string[];
|
|
38
|
+
username?: string;
|
|
39
|
+
credential?: string;
|
|
6
40
|
}
|
|
7
41
|
export interface WebRTCOffer {
|
|
8
42
|
sdp: string;
|
|
@@ -26,6 +60,42 @@ export interface WebRTCParams {
|
|
|
26
60
|
streamOutputNames?: string[];
|
|
27
61
|
dataOutputNames?: string[];
|
|
28
62
|
threadPoolWorkers?: number;
|
|
63
|
+
/**
|
|
64
|
+
* Workflow parameters to pass to the workflow execution
|
|
65
|
+
*/
|
|
66
|
+
workflowsParameters?: Record<string, any>;
|
|
67
|
+
/**
|
|
68
|
+
* ICE servers for WebRTC connections (used for both client and server)
|
|
69
|
+
*
|
|
70
|
+
* Use this to specify custom STUN/TURN servers for users behind
|
|
71
|
+
* symmetric NAT or restrictive firewalls. The same configuration is
|
|
72
|
+
* used for both the client-side RTCPeerConnection and sent to the
|
|
73
|
+
* server via webrtc_config.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```typescript
|
|
77
|
+
* iceServers: [
|
|
78
|
+
* { urls: ["stun:stun.l.google.com:19302"] },
|
|
79
|
+
* { urls: ["turn:turn.example.com:3478"], username: "user", credential: "pass" }
|
|
80
|
+
* ]
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
iceServers?: RTCIceServerConfig[];
|
|
84
|
+
/**
|
|
85
|
+
* Processing timeout in seconds (serverless only)
|
|
86
|
+
* @default 600
|
|
87
|
+
*/
|
|
88
|
+
processingTimeout?: number;
|
|
89
|
+
/**
|
|
90
|
+
* Requested compute plan (serverless only)
|
|
91
|
+
* @example "webrtc-gpu-small"
|
|
92
|
+
*/
|
|
93
|
+
requestedPlan?: string;
|
|
94
|
+
/**
|
|
95
|
+
* Requested region for processing (serverless only)
|
|
96
|
+
* @example "us"
|
|
97
|
+
*/
|
|
98
|
+
requestedRegion?: string;
|
|
29
99
|
}
|
|
30
100
|
export interface Connector {
|
|
31
101
|
connectWrtc(offer: WebRTCOffer, wrtcParams: WebRTCParams): Promise<WebRTCWorkerResponse>;
|
|
@@ -138,7 +208,12 @@ export declare const connectors: {
|
|
|
138
208
|
* imageInputName: wrtcParams.imageInputName,
|
|
139
209
|
* streamOutputNames: wrtcParams.streamOutputNames,
|
|
140
210
|
* dataOutputNames: wrtcParams.dataOutputNames,
|
|
141
|
-
* threadPoolWorkers: wrtcParams.threadPoolWorkers
|
|
211
|
+
* threadPoolWorkers: wrtcParams.threadPoolWorkers,
|
|
212
|
+
* workflowsParameters: wrtcParams.workflowsParameters,
|
|
213
|
+
* iceServers: wrtcParams.iceServers,
|
|
214
|
+
* processingTimeout: wrtcParams.processingTimeout,
|
|
215
|
+
* requestedPlan: wrtcParams.requestedPlan,
|
|
216
|
+
* requestedRegion: wrtcParams.requestedRegion
|
|
142
217
|
* }
|
|
143
218
|
* });
|
|
144
219
|
* res.json(answer);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inference-api.d.ts","sourceRoot":"","sources":["../src/inference-api.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;I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,EAAE,YAAY,CAAC;QAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,kBAAkB,CAAC;KAC7B,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAqF3B,iBAAiB,CAAC,EAAE,UAAU,EAAE,EAAE;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAa/E;AAED;;GAEG;AACH,eAAO,MAAM,UAAU;IACrB;;;;;;;;;;;;;;;;;OAiBG;uBACgB,MAAM,YAAW;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAQ,SAAS;IA2C3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4CG;2BACoB,MAAM,YAAW,OAAO,MAAM,EAAE,GAAG,CAAC,GAAQ,SAAS;CAqB7E,CAAC"}
|
package/dist/webrtc.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webrtc.d.ts","sourceRoot":"","sources":["../src/webrtc.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,SAAS,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"webrtc.d.ts","sourceRoot":"","sources":["../src/webrtc.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,SAAS,EAAE,YAAY,EAAsB,MAAM,iBAAiB,CAAC;AASnG;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,aAAa,CAGN;IAEf;;OAEG;IACH,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI;IAqC9G;;OAEG;IACH,KAAK,IAAI,IAAI;CAGd;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,GAAG;IAAE,OAAO,EAAE,MAAM,C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