jolibrain/livedetect

Can't access to the preview

Tetraneon opened this issue · 3 comments

Bonjour,

Config :

As written in the doc, DeepDetect is launched with :
docker run -d -p 8080:8080 -v $HOME/models:/opt/models jolibrain/deepdetect_ncnn_pi3

DeepDetect is running :

{
"status":{"code":200,"msg":"OK"},
"head":"method":"/info",
"version":"0.1",
"branch":"master",
"commit":"c1fdd1da53d4801bc7048f9f7f58699cf80c8c5d",
"services":[]}
} 

As written in the doc, LiveDetect has been initiated with :

./livedetect-rpi3 \
    --port 8080 \
    --host 127.0.0.1 \
    --mllib ncnn \
    --width 300 --height 300 \
    --detection \
    --create --repository /opt/models/voc/ \
    --init "https://www.deepdetect.com/models/init/ncnn/squeezenet_ssd_voc_ncnn_300x300.tar.gz" \
    --confidence 0.3 \
    -v INFO \
    -P "0.0.0.0:8888" \
    --service voc \
    --nclasses 21

I start LiveDetect with :

./livedetect-rpi3 \
    --port 8080 \
    --host 127.0.0.1 \
    --mllib ncnn \
    --width 300 --height 300 \
    --detection \
    --init "https://www.deepdetect.com/models/init/ncnn/squeezenet_ssd_voc_ncnn_300x300.tar.gz" \
    --confidence 0.3 \
    -v INFO \
    -P "0.0.0.0:8888" \
    --service voc \
    --nclasses 21

LiveDetect starts like a charm :

[✔] [INFO] Starting capture
[✔] [INFO] Device: /dev/video0
[✔] [INFO] Starting web preview on 0.0.0.0:8888
================================================================================
[✖] [WARNING] Model size specified as parameters can't be use for capture with this camera.
[✖] [WARNING] Input image will be resized during DeepDetect processing.
[✔] [1] [INFO] Processing image 2019-07-28-12-01-39
[✔] [1] [INFO] Picture processed in 129.597491ms
================================================================================
[✔] [2] [INFO] Processing image 2019-07-28-12-01-39
[✔] [2] [INFO] Picture processed in 34.107204ms
================================================================================
[✔] [3] [INFO] Processing image 2019-07-28-12-01-39
[✔] [3] [INFO] Picture processed in 32.838772ms
================================================================================
[✔] [4] [INFO] Processing image 2019-07-28-12-01-39
[✔] [4] [INFO] Picture processed in 32.875542ms
================================================================================
[✔] [5] [INFO] Processing image 2019-07-28-12-01-39
[✔] [5] [INFO] Picture processed in 29.66092ms
================================================================================
[✔] [6] [INFO] Processing image 2019-07-28-12-01-39
[✔] [6] [INFO] Picture processed in 34.371006ms

Issue :
The doc says : "The preview is displayed on port 8888, that can be modified with flag". But I can't access in a browser neither with http://localhost:8888, 127.0.0.1:8888, 0.0.0.0:8888 as URL.

This line appears in the terminal :
2019/07/28 12:20:04 Stream: 192.168.1.25:53740 connected

But the browser still waiting during hours, whithout any information, neither json or video.

beniz commented

Hi, usually we use a browser on another device, and thus you may want to access the external IP address of the raspberry, in your case it might be 192.168.1.25, assuming your browser's device lies on the same network as the raspberry.

Yes, I did it. I tried to connect to LiveDetect with my laptop on the same network with its ip 192.168.1.25. The RPi is 192.168.1.78 as ip.
I tried with Firefox and Chrome : the connection persists but the server doesn't send any information.

On the Raspberry, I tried :
sudo curl -X get "http://127.0.0.1:8888"

The connection persist but nothing happens.

Ok.
I change owner and group of directory /home/pi/models to pi:pi and it works.