Comments (7)
I looked into this a little bit,
http://stackoverflow.com/questions/11145109/is-it-possible-to-read-intermittently-sent-data-through-a-named-pipe-using-redir
it seems doing this just by redirecting stdin is infeasible (since the stream will close after the first process that sends data ends), so br -daemon may need to deal with the pipe more explicitly
from openbr.
I should mention, as far as I can tell the situation is worse than reported, after the first writing process closes br is in a busy-wait, and also will not get input from any new processes that try and write to the pipe.
from openbr.
Added in an explicit sleep when no input is available, seems to work for me now:
$ mkfifo mypipe
$ br -daemon < mypipe &
$ echo "-algorithm FaceRecognition" > mypipe
$ top
But @caotto is right about the pipe being closed, more on this to come...
from openbr.
Ok thank you @caotto for working this out with me. The correct usage is now:
$ mkfifo mypipe
$ br -daemon mypipe &
$ echo "-algorithm FaceRecognition" > mypipe
$ echo "-enroll ../data/MEDS/img" > mypipe
$ top
from openbr.
I'm not sure I follow this about the pipe being closed. I have been able to echo commands to the daemon via the pipe repeatedly without it closing (and ceasing to accept commands) for the past few days since jklontz and I worked on it. In any case, the commands you showed above are exactly what I've been doing except I've been using "br -daemon < mypipe" (+ a less-than sign and minus the ampersand). Should I use the above for future builds?
update: Actually, the ampersand is irrelevant. Without it, the terminal becomes occupied. With it, the terminal is released for future commands. So I guess the only difference between what I've been doing and what your instructions say is the "<". Which way is correct?
from openbr.
jklontz modified br -daemon to take the name of the pipe to read from as an input argument (instead of just reading from stdin, which is what br -daemon previously did).
"br -daemon < mypipe" redirects stdin to read from mypipe, which was previously the correct thing to do (br didn't do anything with mypipe directly, it just read from stdin).
For new builds, the correct use is "br -daemon mypipe". br expects the pipe name "mypipe" to be passed as an argument, and br reads directly from that pipe rather than reading from stdin.
The &, like < is a shell command, & tells the shell to run the command asynchronously, so you don't need an ampersand unless you want to run br in the same console you use to send commands to mypipe.
Regarding the pipe closing issue, what OS are you using? I think both Josh and I were using OSX, I don't know offhand but it's possible other operating systems have nicer implementations of named pipes.
Actually, I wonder do you get a busy wait all the time (when running br -daemon with an old build), or only after one process has written to the pipe then exited?
from openbr.
Sweet. Just tested it out. Barely any CPU usage at all when no commands are coming through. Thanks!
from openbr.
Related Issues (20)
- __BEGIN__ is undefined HOT 1
- __END__ is undefined
- Problem in the tests ? HOT 1
- New to this project - about the installation
- Conflict between openbr and dlib
- Build system -- missing QT5 test and opengl v1.1.0 HOT 7
- Clustering usage? understanding rank order neighborhood construction
- OpenCV 4 HOT 4
- Build fails in with VS_2017 and Eigen HOT 1
- Failed to load stasm cascade in FaceRecognition Algorithm
- openbr not working on ubuntu 18.04 HOT 2
- 'br' is not recognized as an internal or external command in windows 10
- Get Fatal Error when try to run "Nmake intall" for building OpenBr HOT 1
- failed to build on windows HOT 1
- Fails to build with OpenCV 3.2.0
- Operating points for ROC curves HOT 4
- CMake Error at openbr/CMakeLists.txt:31 (add_library): Cannot find source file: /usr/local/include/http_parser.c
- how to compute 1:1 face compare accuracy in %
- Missing header file "opencv2/core/core_c.h"
- Fails to build on debian 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openbr.