Data Generation Starter Application¶
Generating Data is the first step in model building, and it can be accomplished in many ways. You can find more information about the different ways to gather data the Data Capture Guidelines document. The Data Generation starter app simplifies data collection and allows you to capture data directly from any platform that you can run alwaysAI on, including the edge device and camera pairing on which you be inferencing. This guide will walk you through the following steps:
(Optional) Set Up the Project on the alwaysAI Dashboard
(Optional) Configuration Options
1. Set Up the Project on alwaysAI¶
i. Click ‘create new project’.
ii. Select ‘start from scratch’ and give your project a name. Then click ‘next’ to proceed.
iii. Do not choose to add a model. Finish creating your project and click on the link to your created project on the subsequent page.
See this page for the complete documentation on setting up projects in the dashboard.
2. Get the Sample App Code¶
i. Either clone or download the repository found on GitHub into a local directory where you’d like your app to run. This will be your project directory.
3. Configure the Local Directory¶
i. On your command line, navigate into the directory where the project code is located on your local computer.
ii. If you did not configure your project on the dashboard, simply enter
aai app configure in the terminal and follow the prompts to create a new project. Otherwise, if you did create your project via the dashboard, you can enter
aai app configure and use the arrows to find your project, or you can simply use the
aai app configure --project <hash> command provided on your project page in the Dashboard.
iii. The tool will automatically detect the
app.py and should write a
4. Build and Start the Application¶
Enter into the command line
$ aai app install
And subsequently enter
$ aai app start
Open a browser to
localhost:5000 to start collecting data! Once you’re done, click the red square in the browser window to stop the app.
Your data will be in your local directory, in a folder called
5. Configuration Options¶
To set the sample rate of the data collection, find the “SAMPLE_RATE” variable near the top of the app.py file. The value of this variable will determine the number of frames captured per second. For example:
SAMPLE_RATE = 5
denotes that 5 frames per second will be used, whereas
SAMPLE_RATE = .25
denotes ¼ of a frame per second, or 1 frame every 4 seconds, will be used.
Note: You will not be able to capture more frames per second than your hardware is capable of capturing.
This is a simple data collection app, for more advanced sampling we recommend using third party software tools such as FFmpeg.