pjreddie / darknet

Convolutional Neural Networks
http://pjreddie.com/darknet/
Other
25.51k stars 21.32k forks source link

Streaming darknet to browser (HTTP MJPEG), is there a command/way to view darknet streaming output on a browser with a URL? #1571

Open ngingihy opened 5 years ago

ngingihy commented 5 years ago

./darknet detector demo custom/trainer.data custom/yolov3-tiny.cfg yolov3-tiny_1200.weights http://10.8.0.186:8001/cam.mjpg -i

This is the command i use for running darknet on a camera feed. i want to have darknet output on the browser using http. Is there a way to do that?

AlexeyAB commented 5 years ago

Yes, use this repository: https://github.com/AlexeyAB/darknet

Run such command: ./darknet detector demo ./cfg/coco.data ./cfg/yolov3.cfg ./yolov3.weights test50.mp4 -json_port 8070 -mjpeg_port 8090 -ext_output

Then just open in Web-browser (Chrome/Firefox): http://localhost:8090 and http://localhost:8070


Also you can add flag -dont_show if you run Darknet via SSH.

Also read: https://github.com/AlexeyAB/darknet/issues/2969#issuecomment-484971112

ngingihy commented 5 years ago

I cloned and used your repo, ran this command "./darknet detector demo ./cfg/coco.data ./cfg/yolov3.cfg ./yolov3.weights http://10.8.0.186:8001/cam.mjpg -json_port 8070 -mjpeg_port 8090 -ext_output" Still didn't see any output, i got a segmentation fault error (pasted below).

Total BFLOPS 65.864 Loading weights from ./yolov3.weights... seen 64 Done! video file: http://10.8.0.186:8001/cam.mjpg Video stream: 1920 x 1080 Objects:

JSON-stream sent.

FPS:0.0 Objects:

JSON-stream sent. Segmentation fault (core dumped)

AlexeyAB commented 5 years ago

Try to run ./darknet detector demo ./cfg/coco.data ./cfg/yolov3.cfg ./yolov3.weights http://10.8.0.186:8001/cam.mjpg -mjpeg_port 8090 -ext_output

Also check that you URL works http://10.8.0.186:8001/cam.mjpg

ngingihy commented 5 years ago

It worked. Thank you! I just have a couple of questions I'm confused about 3 questions listed below, I'd really appreciate if you can answer them.

1)What's the difference between YOLOV3 AND YOLOV3-tiny? 2)For training, is it okay to have pictures of different sizes? Do I need to have all pictures have the same size? 3)For training, I want to detect close and very far away drones. What is the recommended width and height should I change in the cfg file? what other values are recommended for detecting small objects? (I'm training on a pre-trained drone-net weight file)

Thanks again!

HieuNguyenTrong commented 4 years ago

Hello,

Based on this issue, i have one question. Please let me know if you can. I wanna use a custom browser instead of using the localhost in order to stream json data, and extract json data from that stream through html such as getJson(). I tried all the time to make a custom json data, and stream through http://localhost:8070, and display in a custom html instead of typing http://localhost:8070. But I can't get json data in real-time.

Thank you in advance.

FatemaD17 commented 2 years ago

Hello,

I am trying to get JSON stream. I am running from colab so what would be the changes in the url?