Package: python-sand
Sensor and Neural Data Platform (SAND)This project aims to make working with camera-streams (or video-streams in
general) easy, by providing an extensible framework to read, manipulate and
republish images.It was originally designed to manage an Object-Detection-System we setup on a
tri-modal crane. The focus of this was to detect humans (and biomass in general)
to make the processes at container-harbors safer in general.While developing we already recognized, that it could also be useful for generic
usages, especially just recording some simple streams or do some light work,
like republishing streams.How to setupIn general the installation process is quite simple. We described the simple
terms here, but if you need a reference of some sort, we can recommend taking a
look at ourDockerfilethat we use for
CI-purposes.PrerequisitesSystem DependenciesYou need those in any case:gccbuild-essentiallibcap-devpython3-devNeural NetworkIf you want to use a demo yolox please download the weights for YOLOX-X (trained
on the COCO dataset) fromhereand either put them directly in./config/detector_models/yolox/yolox_x_cocoor
use a symlink.Development setupIf you only want to use SAND directly, you can skip this section. Although we
can very much recommendpoetryin general for your own python projects.We usepoetryto manage our dependencies. To installpoetryyou can use(more infos here):$curl-sSLhttps://install.python-poetry.org|python-Our dependencies are documented in thepyproject.toml, the
explicit versions with hashes for the libraries you can find inpoetry.lock.In the following section you will see what different variants of the system we
actually have.InstallationAttention: As "just" a user you probably don't want to installpoetryor any
dev-dependencies. Therefore you should always look at thepip installvariant.We have a couple of variants for the system, depending on what you want to do
with it. They can also be combined with each other if you want to use multiple
features. For development and especially unittesting you will need all extras:neural$poetryinstall--extras="neural"$pipinstallpython-sand[neural]This installs all the dependencies that have something to do with machine
learning or neural networks. The main dependency here is theMLCVZoowhich
provides us with an easy interface to work with inference and the results of
it in general. If you want to configure some kind of object-detection this
and the corresponding component in our system
(NeuralNetwork) are a good starting
point to look into.metric$poetryinstall--extras="metric"$pipinstallpython-sand[metric]This concerns everything around an influx-db and metrics with a
grafana-dashboard. So if you want to monitor performance of basically
everything in our system you can start here. This absolutely needs a running
MQTT-Broker that the system can connect to. For development and "light"
running we have a mosquitto docker container setup in thedocker-compose.yml.docker-composeis also installed
via ourdev-dependencieswhich get installed regardless of extras if you
install it viapoetry. You will also need an influx-dbv2.$ docker-compose up -d mqtt influxdb grafanapublisher$ poetry install --extras="publisher"
$ pip install python-sand[publisher]This basically gives you the tools to setup a basic flask server to deliver
in our case a static website where you can watch your streams in a basic
dashboard.SystemIf you have installedpython-sandin your environment it provides a couple of
binaries, that you can use to start different parts of the system.sandThis is the main starter for the "normal" system. It has a couple of options
so be sure to take a look (via the normalsand --help)Long-term SystemIf you want to run install it on the actual system where it should run
long-term, we opted for a systemd-service to make starting/stopping very easy
and also the logging gets easier. You probably still want to adapt it slightly
to use your specific config or use additional links to match the default config
name. You find the systemd file in this repository, it will not come bundled in
the python artifact.Installation:# cd /etc/systemd/system# ln -s /path/to/sand/sand.service .After that you can start/stop it via:# systemctl start sandAlso the logs on the INFO-Level are routed through the journal, which is why you
can also read most of the logs via:# journalctl -u sandFAQMore like "We asked them ourselves at one point, and tried to find a spot where
to save the knowledge".How can you reset the admin password in grafana docker container?$dockerexecCONTAINER_IDgrafana-cliadminreset-admin-passwordadmin