Uploading data from google colab

Hello there,
I am currently working with esp32 cam, my model training and dataset are both on google colab, I could not find a way to stream my training data directly from google colab to edge impulse, any help will be appreciated

Hello @Faisal_Sani_Bala,

I guess you want to push some images right?

You can use the following code entries in your notebook:

To install Edge Impulse CLI:

!npm install -g --unsafe-perm edge-impulse-cli

And to push the data:

# Set your API Keys
api_key = 'ei_55a76...your API KEY'

# Your directory containing your data
output_dir = './your-directory'
# If you have one label per directory you can do:
labels = ['label1', 'label2', 'label3']

for label in labels:
  sample_dir = output_dir + '/' + label + '/*.jpg'
  print("Uploading files from ", sample_dir)
  cmd = 'edge-impulse-uploader --api-key ' + api_key + ' --label ' + label + ' ' + sample_dir
  os.system(cmd)

print("Done!");

Best regards,

Louis

2 Likes

Louis thank you so much, I will try it and see the outcome

1 Like

Helli lious, I had it on the screen that the upload is successful, however I could not locate it on my edge impulse dashboard

Hi @Faisal_Sani_Bala,

Try using output_dir = './content' instead of output_dir ='./content/'
I guess it should solve your issue :slight_smile:

Best,

Louis

Hello, @louis I tried out the same thing from my Google Colab. It showed that the upload is successful. However, I cannot locate the dataset on my Edge Impulse dashboard
Also, in general, where will the dataset appear after it is uploaded?

Hello @sohamc1909,

Can you see your data in the Data acquisition page on the left menu?
If not can you make sure the API Key you used is the right one for your project? (Dashboard->Keys)

Best,

Louis

Hey! Thanks, I could figure it out. It works now!