Package: visionai
Ready to deploy Vision AI scenarios. Open source. Try our CLI now.Documentation:https://docs.visionify.aiSource Code:https://github.com/visionify/visionaiVisionAIprovides a set of command line utilities for running Vision AI scenarios. We also have several industrial use-cases that are ready for production deployment. VisionAI is primarily a CLI (Command Line Interface) - but it also provides a Web-based GUI for managing your cameras. VisionAI is a developed by the team atVisionify- and is a part of theWorkplace Safetysuite of products.Key features ofVisionAIinclude:Easy to use: VisionAI is designed to be a no-code platform for deploying Vision AI solutions for common  workplace safety scenarios. The command-line interface (CLI) or Web interface are designed to be used by non-technical users as well as technical users.Production Ready: VisionAI provides a library of production-ready Workplace Safety scenarios that can be directly used out of the box. Each of these scenarios is trained from a large dataset of real-world images and videos.Open Source: VisionAI library is Open Source is available through GPLv3 license. You can use it for free and contribute to it as well. We also offer commercial licenses to enterprises that want to modify the codebase.Custom Scenarios: VisionAI can supports custom use-cases and scenarios. We have a flexible architecture based on NVIDIA triton server to serve multiple models, and common scenario pattern that can be used to easily add new use-cases. Check the customization documentation to get more information on how this can be achieved.Integrations: VisionAI currently integrates with REDIS PubSub and Azure Event hubs for alerts and notifications. We have roadmap plans to add support for other message brokers as well.Cloud Ready: VisionAI is available as as an Azure Marketplace offer. This provides scalable architecture for enterprise installations supporting a large number of cameras and scenarios.ScenariosWe support several Workplace health and safety scenarios. These are listed below. We are continuously adding new scenarios and you cancontact usif you need a scenario that is not listed here.VisionAIfocuses on workplace health and safety models - and majority of the models you see here have been developed with that in mind. We are continuously working on new scenarios - and our current scenario repo consists of over 60 scenarios that are listedhere.Quick StartInstallVisionAIapplication throughPyPI.$pipinstallvisionaiInitialize visionai by running the following command. This would download the required dependencies on your setup. This might take a few minutes to complete as some of the dependencies are pretty large in size (1GB for Pytorch etc.)$visionaiinitOnce the initialization is successful, you can see the following output:$visionaiinit
---------------------------
Grafanaserverisat:http://localhost:3003
Redisserverisat:localhost:6379
Tritonhttpserverisat:http://localhost:8000
Tritongrpcserverisat:grpc://localhost:8001
Tritonprometheusmetricsserverisat:http://localhost:8002/metrics
APIserveralreadyrunningat:http://localhost:3002
Webserveralreadyrunningat:http://localhost:3001This indicates that different services required for running VisionAI are running on your machine.ServicePortPurposeWeb UIhttp://localhost:3001VisionAI Web-appWeb APIhttp://localhost:3002VisionAI API serviceTriton HTTPhttp://localhost:8000Triton Model server (http)Triton GRPCgrpc://localhost:8001Triton Model server (grpc)Triton Metricshttp://localhost:8002Triton Model metrics server (prometheus)Redisredis://localhost:6379Redis server, currently supports PUBSUBGrafanahttp://localhost:3003Grafana server for charting & graphingTo list down available scenarios by running the following command.$visionaiscenarioslistRun a scenario by running the following command. This would run the scenario on your local web-cam.$visionaiscenariostestppe-detectionYou can observe the command prompt for the output of the scenario. This scenario generates events when a person is detected without a PPE.You can also run this scenario on IP camera (RTSP, RTMP, RTP, HLS etc). For example:$visionaiscenariostestppe-detection--camerartsp://192.168.0.1:554/1You can also run this scenario on a video file. For example:$visionaiscenariostestppe-detection--video/path/to/video.mp4You can also create a pipeline to run multiple scenarios on a single camera. For example:$visionaicameraadd--nameOFFICE-01--urlrtsp://192.186.0.1:554/1
$visionaipipelinecreate--nametest-pipeline--cameraOFFICE-01
$visionaipipelineadd-scenario--nametest-pipeline--scenarioppe-detection
$visionaipipelineadd-scenario--nametest-pipeline--scenarioface-blur
$visionaipipelineadd-scenario--nametest-pipeline--scenariosmoke-and-fire-detection
$visionaipipelinestart--nametest-pipelineVisionAI also supports a web-based option for managing cameras, scenarios and pipeline. You can run the following command to start the web-based GUI. Once the web-based GUI is started, you can access it athttp://localhost:3001.$visionaiwebstart

WebserviceAPIavailableat:http://localhost:3002
Webappavailableat:http://localhost:3001This would show an initial screen similar to this:.You can manage cameras, scenarios, pipelines, see events etc., directly on the web-app. The web-app is running your own local compute instance. All the data is saved in your machine, and it is persistent as long as VisionAI application is not uninstalled.VisionAI supports out-of-box integration with Redis, Prometheus, Grafana and Azure Event Hub. Once the web-app is started, you can view the Grafana dashboard at:http://localhost:3003. The default username and password isadmin/admin.Grafana server is at: http://localhost:3003
Redis server is at: redis://localhost:6379Deploy toAzureDeploy a fully configured and tested solution directly from Azure Marketplace.VisionAIruns computer vision models, most of which run orders of magnitude faster if executed on a GPU machine. Our Azure Marketplace offerVisionAI Community Editionis available through Azure Marketplacehere(TODO). The community edition deploys a fully configured Virtual Machine with the recommended hardware and software options.TODO: Point to ARM template that needs to be deployed (using theseinstructionsand here is an exampleJSON file).ScenariosVisionAIis organized in terms of scenarios. Consider each scenario as being a business use-case, that is solved by a combination of Machine Learning models and an inference algorithm. For exampleWarn me when max occupancy of this area exceeds 80 peopleis a business scenario, where as thePeople detectionis an ML model.VisionAIsupports 60 scenarios currently and more are being added continuously. Our current focus is on Workplace Safety scenarios. Pleasecontact usif a scenario you need is not present in our repo and we will look into it.$visionaiscenarioslistModelsTo support the running various scenarios - VisionAI relies a set of Machine Learning models that have been specifically trained with Industrial use-cases datasets. These models must be served through NVIDIA triton framework. VisionAI makes serving these models easy through a single command-line interface:$visionaimodelsserveAny time a new scenario is downloaded, the model server is automatically restarted to load and serve the new model. You can check the status of models being served by VisionAI through the following commands.$visionaimodelslistDon't think you'll need to shut down the model server. However, if you do, you can do so through the following command.$visionaimodelsstopCamerasYou can add/remove cameras through the following commands.$visionaimodelsadd--nameOFFICE-01--urlrtsp://192.168.0.1:554/1
$visionaimodelsremove--nameOFFICE-01You can find the named camera instances through thecameras listcommand.$visionaicameraslistPipelinesPipelines allow running complex scenarios (one after another, or in parallel) on a single camera. You can create a pipeline through the following command.$visionaipipelinecreate--nametest-pipeline--cameraOFFICE-01You can add a scenario to a pipeline through the following command.$visionaipipelineadd-scenario--nametest-pipeline--scenarioppe-detectionYou can start a pipeline through the following command.$visionaipipelinestart--nametest-pipelineYou can stop a pipeline through the following command.$visionaipipelinestop--nametest-pipelineEventsVisionAI supports a variety of events that can be used to trigger actions. Our primary mode of events is through PubSub mechanism. VisionAI supports redis pubsub, and Azure Event Hub for posting events. These can be later extended to support emails alerts, SMS alerts, and other mechanisms.Each event is in the form of a JSON object. The following is an example of an event that is posted when a smoke is detected by the smoke-and-fire-detection scenario.{"camera":"camera-01","scenario":"smoke-and-fire-detection","event_name":"smoke-detected","event_details":{"camera":"camera-01","date":"2023-01-04 11:05:02","confidence":0.92}}To listen to events, you can subscribe to the redis pubsub mechanism as follows:importredisr=redis.Redis(host='localhost',port=6379,db=0)p=r.pubsub()p.subscribe('visionai')formessageinp.listen():print(message)Web AppVisionAI comes with a web app that can be used to view the events and the status of the system. You can perform all of the activities that are supported through the CLI through the web app as well. In order to start the web-app, use the following command:$visionaiwebNextstepsCongratulations! You have successfully configured and used VisionAI toolkit. Now go throughTutorialsto learn about how to run multiple scnearios, how to configure each scenario for the events you need, how to set up pipelines with multiple cameras and scenarios.Or you can also browse through ourscenariossection to understand different use-cases that are supported currently. If you have a need for a scenario, do not hesitate to submit arequesthere.ContributingWe welcome contributions to VisionAI. Please read ourcontribution guidelinesto learn about how you can contribute to VisionAI.LicenseVIsionAI is licensed under theGPLv3 License. If you need a commercial license, pleasecontact us.