From 74ac5a903d2fe288df572fe275f773f9befb5b4c Mon Sep 17 00:00:00 2001 From: Brandon Rozek Date: Sun, 3 May 2020 21:19:41 -0400 Subject: [PATCH] Combined into main due to async ordering errors --- server.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/server.js b/server.js index 06a694e..5582c9b 100644 --- a/server.js +++ b/server.js @@ -3,18 +3,13 @@ const tf = require('@tensorflow/tfjs-node'); const bodyPix = require('@tensorflow-models/body-pix'); const {decodeJpeg} = require('./decode_image'); -let net = null; - -async function load() { - net = await bodyPix.load({ +async function main() { + const net = await bodyPix.load({ architecture: 'MobileNetV1', outputStride: 16, multiplier: 0.5, quantBytes: 2 }); -} - -async function run() { const sock = new zmq.Reply; await sock.bind('ipc:///tmp/bodypix'); @@ -28,5 +23,4 @@ async function run() { } } -load(); -run(); +main();