javascript-sdk icon indicating copy to clipboard operation
javascript-sdk copied to clipboard

USE JAVASCRIPT-SDK IN NODE-RED

Open mas1515 opened this issue 5 years ago • 20 comments

is it possible use object detection in node-red ????

can you send source code for check ?

mas1515 avatar Jun 12 '20 09:06 mas1515

Yes it’s possible. In what way would you like to use it in node red?

I have a demo that uses node red, but it’s mainly for streaming video from a raspberry pi or drone and doing detections on that. It might not be too useful for you

bourdakos1 avatar Jun 12 '20 12:06 bourdakos1

Here’s a video that goes over object detection with node red https://youtu.be/h_-wTXlX2Ms

It doesn’t actually do the actual object detection in a node red node though. It still does it in the browser so you can get real-time predictions. However it shouldn’t be too difficult to make a node red node that does detections. You wouldn’t be able to use this sdk though because it only works in the browser. You need to do it using TensorFlowjs-node

bourdakos1 avatar Jun 12 '20 12:06 bourdakos1

hello @bourdakos1 i want to get video from ip camera with ffmpge and rtsp address . after that object detecting on video.
i think in node-red i can do it easier .

mas1515 avatar Jun 12 '20 12:06 mas1515

where is source code for this video ???? https://youtu.be/h_-wTXlX2Ms

mas1515 avatar Jun 12 '20 12:06 mas1515

my Big problem is get rtsp video from ip camera in web browser for using javascript sdk and object detection do you have a solution for it ????

mas1515 avatar Jun 12 '20 12:06 mas1515

I don't have too much experience with IP cameras, how do they work?

bourdakos1 avatar Jun 12 '20 13:06 bourdakos1

@bourdakos1

ip camera has an address like this for get video rtsp://admin:[email protected]:554/cam/realmonitor?channel=1&subtype=0

for test react object detection app with ip camera we have to use rtsp address but i cant find easy solution for this ,

i test this solution i made a node js app that use socket.io for send video to client and

But in client side (react app) i dont know how show video(get video) in react app with this code import * as io from 'socket.io-client'

can you help for this ? or better solution

mas1515 avatar Jun 12 '20 13:06 mas1515

okay, so I think you'll need to use ffmpeg to restream rtsp as HLS and then this might be useful: https://github.com/cloud-annotations/object-detection-live-stream

bourdakos1 avatar Jun 12 '20 19:06 bourdakos1

Actually this is probably more useful https://github.com/cloud-annotations/raspberrypi-streaming-object-detection

bourdakos1 avatar Jun 12 '20 19:06 bourdakos1

if you can send me a live camera address I can try to get it working

bourdakos1 avatar Jun 12 '20 19:06 bourdakos1

@bourdakos1 thanks for helping this is many rtsp link that you can test

rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov

rtsp://170.93.143.139/rtplive/470011e600ef003a004ee33696235daa

rtsp://freja.hiof.no:1935/rtplive/definst/hessdalen03.stream

thank you man my problem is to get video from rtsp address in react app for object detection .

mas1515 avatar Jun 12 '20 19:06 mas1515

Okay, I think I have something working! It works with all 3 of these addresses

bourdakos1 avatar Jun 12 '20 20:06 bourdakos1

https://github.com/cloud-annotations/ip-camera-object-detection

change the STREAM_URL to your url

npm install
npm start

bourdakos1 avatar Jun 12 '20 20:06 bourdakos1

@bourdakos1 This code works for rtsp address i tested it , Thank you very much and thank you for your help ,

i have another question , how use this code without internet (offline) can i load this link locally ??

mas1515 avatar Jun 12 '20 20:06 mas1515

yea just download this file: https://cdn.jsdelivr.net/npm/@cloud-annotations/[email protected] and save it locally as models.js in the js then update the script tag to be:

<script src="js/models.js"></script>

bourdakos1 avatar Jun 12 '20 22:06 bourdakos1

@bourdakos1

i tested it works thank you ,

another question is it possible have two video on same page for object detection ???

two rtsp address link for two camera i mean .

mas1515 avatar Jun 14 '20 11:06 mas1515

yea, it's possible, but running more that one object detection detector simultaneously will probably be slow

bourdakos1 avatar Jun 14 '20 16:06 bourdakos1

i have goood pc for test it .

can you send code for two object detection ???

mas1515 avatar Jun 14 '20 18:06 mas1515

I don't have code for it and I don't really have much time this week to build it.

You could modify the ip-camera code to have dynamic stream routes instead of one /stream

bourdakos1 avatar Jun 15 '20 16:06 bourdakos1

@bourdakos1

it is not hurry for make code , you helped me very much

i dont know very ffmpeg in nodejs

can you send me link for learning it ????

i need two object detection(rtsp address) on same page ,

mas1515 avatar Jun 18 '20 13:06 mas1515