Face detection with Docker/Machinebox

I’m thinking of adding a service so you can just post files for processing too, skip the display unless something interesting is identified in the image

hello, I have this error on running the templete:
message: ‘{% if states.sensor.facebox_detection.state != “unknown” %} {{ states<“sensor.facebox_detection”> }} is at the door {% else %} {% endif %}’
the following error: Error rendering template: TemplateSyntaxError: unexpected ‘end of print statement’
any idea?

Please use markdown formatting when posting code:

My_code

Am I doing something wrong? Every time I try to run Facebox, I get the following:

docker run -p 8080:8080 -e "MB_KEY=$MB_KEY" machinebox/facebox
2018/06/07 23:32:54 Number of MB_WORKERS is set to 4
[INFO]     starting...

        Welcome to Facebox by Machine Box
        (facebox development)

        Visit the console to see what this box can do:
        http://localhost:8080

        If you have any questions or feedback, get in touch:
        https://machinebox.io/contact

        Please consider buying a subscription:
        https://machinebox.io/#pricing

        Report bugs and issues:
        https://github.com/machinebox/issues

        Tell us what you build on Twitter @machineboxio

[ERROR]    post shutdown: accept tcp [::]:8080: use of closed network connection
[CRITICAL]    command exited during start up
2018/06/07 23:32:57 command exited during start up

Machine has a quad core CPU and 8GB of ram. Any ideas anyone?

Check you have the latest release of facebox. It appears to be a port/networking problem, so I encourage you to also post on the Machinebox forum

@kingofsnake of realise that this component does fire events, and have updated the Github readme

Thanx Rob been short of time lately but will try it out soon!
Well soon was right now :wink: Got it working in 10 minutes! Event triggered so great job again.

@robmarkcole i’m trying to implement your facebox_python script. I’m running HassIO and i’ve placed it in my python script folder. Where would i place the face folder directory and how can i modify the script to look at the different directory? If its not possible how would I go about setting up a command_line switch within HassIO?

Thanks Rob! Events simplify things so much!

HI @Maaniac haven’t tried myself but the command_line docs should explain, I imagine this will be very simple.

@kingofsnake I’ve a PR to address a current issue with triggering automaitions with facebox events. In the meantime my Github repo has the most current branch of the component so please try that if you have any issues.

@robmarkcole is there anyway to modify the script to point to a particular folder within /config?

Yes the path is in the script, just change that :+1:

@robmarkcole thanks but I would have no idea where to look or what to change :slight_smile:. I’ll just continue doing it manually i guess.

OK the script must be run from within the folder of images as in the readme https://github.com/robmarkcole/facebox_python

@robmarkcole I read in the hackster.io tutorial you are running Facebox on a upgraded DS216++ with 8GB. I’m trying to get Facebox running on the same machine but run into similar issues as already posted in this thread. See the log below. Did you do anything special to get Facebox up and running on your DS216++?

|2018-06-14 17:35:24|stdout|Tell us what you build on Twitter @machineboxio|
|---|---|---|
|2018-06-14 17:35:24|stdout||
|2018-06-14 17:35:24|stdout|https://github.com/machinebox/issues|
|2018-06-14 17:35:24|stdout|Report bugs and issues:|
|2018-06-14 17:35:24|stdout||
|2018-06-14 17:35:24|stdout|https://machinebox.io/#pricing|
|2018-06-14 17:35:24|stdout|Please consider buying a subscription:|
|2018-06-14 17:35:24|stdout||
|2018-06-14 17:35:24|stdout|https://machinebox.io/contact|
|2018-06-14 17:35:24|stdout|If you have any questions or feedback, get in touch:|
|2018-06-14 17:35:24|stdout||
|2018-06-14 17:35:24|stdout|http://localhost:8080|
|2018-06-14 17:35:24|stdout|Visit the console to see what this box can do:|
|2018-06-14 17:35:24|stdout||
|2018-06-14 17:35:24|stdout|(facebox development)|
|2018-06-14 17:35:24|stdout|Welcome to Facebox by Machine Box|
|2018-06-14 17:35:24|stdout||
|2018-06-14 17:35:24|stdout|[INFO]     starting...|
|2018-06-14 17:35:23|stdout|2018/06/14 17:35:23 Number of MB_WORKERS is set to 4|
|2018-06-14 17:35:20|stdout|2018/06/14 17:35:20 command exited during start up, make sure the container has enough RAM available to start, check out https://machinebox.io/docs/setup/docker#minimum-requirements|
|2018-06-14 17:35:20|stdout|[CRITICAL]    command exited during start up, make sure the container has enough RAM available to start, check out https://machinebox.io/docs/setup/docker#minimum-requirements|
|2018-06-14 17:35:20|stdout|[ERROR]    post shutdown: accept tcp [::]:8080: use of closed network connection|

(there is almost 8 GB of RAM available for the container)

@Phuturist I just pulled the latest version of facebox, and I am now getting the same error…! Will raise the topic on the Machinebox slack channel

1 Like

Great, you can reference to this github ticket: https://github.com/machinebox/issues/issues/30

Im no Docker expert, but presume an earlier release can be pulled

Unfortunately Machinebox only seems to maintain the latest tag on Docker hub (https://hub.docker.com/r/machinebox/facebox/tags/). So I would not know how to pull an older version but I’m not docker expert myself as well.

I spoke with them and hopefully they will have a solution soon. In the meantime you could try one of the cloud hosted solutions (DigitalOcean or Google Cloud)