Previous
Act based on inferences
When you configure the data management service, Viam automatically uploads data from the default directory ~/.viam/capture
and any directory you configured.
If you want to upload a batch of data to train ML models on from an external source you can also:
Typically, you configure the data service to sync data from your machine at regular intervals indefinitely. However, if you already have a cache of data you’d like to use with Viam, you can temporarily modify your configuration to sync a batch of data and then revert your config changes after the data is uploaded.
This method of uploading data will delete the data from your machine once it is uploaded to the cloud.
If you do not want the data deleted from your machine, copy the data to a new folder and sync that folder instead so that your local copy remains.
1. Organize your data
Put the data you want to sync in a directory on your machine. All of the data in the folder will be synced, so be sure that you want to upload all of the contents of the folder.
2. Configure sync from the additional folder
In the Additional paths, enter the full path to the directory where the data you want to upload is stored, for example, /Users/Artoo/my_cat_photos
.
Toggle Syncing to on (green) if it isn’t already on.
Click Save in the top right corner of the page.
3. Confirm that your data uploaded
Navigate to your DATA page in the Viam app and confirm that your data appears there. If you don’t see your files yet, wait a few moments and refresh the page.
4. Remove the folder path
Once the data has uploaded, navigate back to your data service config. You can now delete the additional path you added. You can also turn off Syncing unless you have other directories you’d like to continue to sync from.
You can use the Python data client API file_upload_from_path
method to upload one or more files from your computer to the Viam Cloud.
Unlike data sync, using the file_upload_from_path
API method uploads all the data even if that data already exists in the cloud.
In other words, it duplicates data if you run it multiple times.
Also unlike data sync, this method does not delete data from your device.
1. Get API key
Go to your organization’s setting page and create an API key for your individual machine part, machine, location, or organization.
2. Add a file_upload_from_path
API call
Create a Python script and use the file_upload_from_path
method to upload your data, depending on whether you are uploading one or multiple files:
To upload just one file, make a call to file_upload_from_path
.
To upload all the files in a directory, you can use the file_upload_from_path
method inside a for
loop.
3. Run your code
Save and run your code once. Running your code more than once will duplicate the data. View your uploaded data in your DATA page in the Viam app.
Upload images as machine data straight from your phone, skipping the normal data capture and cloud synchronization process, through the Viam mobile app. This is useful if you want to capture images for training machine learning models on the go.
1. Navigate to your machine
In the Viam mobile app, select an organization by clicking on the menu icon in the top left corner and tapping an organization.
Tap the Locations tab and select a location, then select the machine you want your data to be associated with.
2. Upload images
Tap the menu button marked “…” in the upper right corner. Tap Upload Images.
Select each image you want to upload, then tap Add.
The uploaded images metadata will contain the machine part you selected. However, the uploaded images will not be associated with a component or method.
Now that you have a batch of data uploaded, you can train an ML model on it. Or, if you want to collect and upload data not in a batch, see Create a dataset.
Was this page helpful?
Glad to hear it! If you have any other feedback please let us know:
We're sorry about that. To help us improve, please tell us what we can do better:
Thank you!