node-yolo icon indicating copy to clipboard operation
node-yolo copied to clipboard

Decode data client side

Open xseignard opened this issue 6 years ago • 4 comments

Hello again,

I'd like to send the modified image frame via websockets to a client.

For now all what I get is a green image on the client side, I assume I do something wrong, any idea on how to decode the frame client side? or server side to then send it as a jpeg base64.

See my code here: https://github.com/xseignard/yolo9000-test/blob/9e4f1723c98912fd92683902bf8b67f44025a492/src/public/main.js#L14-L26

Best regards

xseignard avatar Oct 11 '17 09:10 xseignard

Hi @xseignard so far I have decoded with ffmpeg only https://github.com/moovel/node-yolo/blob/master/test/darknetImageTest.js#L12

It requires the pix_fmt set which basically defines the order of colors. For me, bgr24 is working but I have also experienced that different opencv versions have different default pixel format.

OrKoN avatar Oct 11 '17 11:10 OrKoN

Please note that the image recognition won't work concurrently so you will need to make sure only one image is recognized at a time.

OrKoN avatar Oct 11 '17 11:10 OrKoN

Yes, it works server side for me too, and sending the image encoded as base 64 through websocket also works. But I'm pretty sure the decoding of the raw rgb24 data can be achieved client side, it will eliminate the burden of using ffmpeg on the server side. I haven't found a solution so far. I'll investigate it further.

xseignard avatar Oct 11 '17 14:10 xseignard

Hi @xseignard have you found a solution?

OrKoN avatar Oct 29 '17 09:10 OrKoN