SFE Components === SFE Stream processor consists of following executables: * sfe_stream_processor * mqtt-v5-broker * sfe_client_rest * sfe_settings_server - optional ## SFE Stream Processor SFE Stream Processor processes the camera input, detects faces, detects landmarks, extracts template, matches the extracted template against the database and sends MQTT message to MQTT broker. The configuration of SFE stream processor is loaded from ```settings.yaml``` file which comes as input argument. ``` ./sfe_stream_processor settings.yaml ``` Find more information about settings in ```doc/settings.yaml_documented```. ## MQTT broker MQTT broker is necessary to run on the camera as there is a MQTT Client running both in SFE Stream Processor and SFE REST Client. One MQTT Client publishes MQTT messages to specific MQTT topic where the other MQTT Client is subscribed to. ## SFE REST Client SFE REST Client is responsible for translation of HTTP requests to MQTT messages and MQTT messages to HTTP responses. The MQTT connection information are read from ```settings.yaml``` file which comes as input argument. You also have to specify the IP address and port where the REST server listens to the requests. Example: ``` ./sfe_client_rest settings.yaml 10.11.80.38 4242 ``` ### Watchlist member management #### POST /api/v1/WatchlistMembers/{id}/AddFace Register new watchlist member or add face to existing watchlist member: * If the watchlist member with specified ID does not exist, new watchlist member is registered. * If the watchlist member with specified ID already exists, a face is added. Path parameters: * id - The ID of watchlist member to add new face Request body: * data - Binary data containing image in JPEG format or a valid face template Response: * The response contains the face template encoded in base64 if the face was added successfully. * Otherwise, it returns an error. Example: ```(need add -X) curl POST http://10.11.80.38:4242/api/v1/WatchlistMembers/lipo/AddFace -T C:\Users\mlipovsky\Downloads\lipo.jpg ``` #### GET /api/v1/WatchlistMembers Get all watchlist members. Response: * The response contains all watchlist members with their face templates encoded in base64. * Otherwise, it returns an error. Example: ``` curl GET http://10.11.80.38:4242/api/v1/WatchlistMembers ``` #### GET /api/v1/WatchlistMembers/{id} Get watchlist member with specified ID. Path parameters: * id - The ID of watchlist member to get Output: * If a watchlist member with specified ID exists the response contains this watchlist member ID with his face templates encoded in base64. * Otherwise, it returns an error. Example: ``` curl GET http://10.11.80.38:4242/api/v1/WatchlistMembers/lipo ``` #### DELETE /api/v1/WatchlistMembers/{id} Delete watchlist member with specified ID. Path parameters: * id - The ID of watchlist member to delete Output: * If a watchlist member wih specified ID exists the response contains this watchlist member ID with his face templates encoded in base64. * Otherwise it returns an error. Example: ``` curl DELETE http://10.11.80.38:4242/api/v1/WatchlistMembers/lipo ``` ### Frame data stream - /api/v1/frame_data Returns the frame_data of actual frame in JSON format. The structure of `FrameData` is documented in ```doc/frame_data.proto``` Example: ``` websocat ws://10.11.80.38:4242/api/v1/frame_data ``` ## SFE Setting server You can use SFE Setting server to be able to modify the configuration via Web UI. It basically changes the content of ```settings.yaml``` file which comes as input argument. You also have to configure the IP address and port where the settings UI is available. ``` ./sfe_settings_server --address 0.0.0.0 --port 8592 --settings-file settings.yaml ``` Then you can use the following URL (IP address of the camera and specified port) to access and modify the configuration. ``` 10.11.80.38:8592 ``` Scroll down and click the ```Submit``` button to save and apply the changes. The SFE Stream Processor listens to changes in ```settings.yaml``` and reloads the configuration if necessary.