Copying data from one project to another

Dear Edge Impulse Community,

I need a little help, I’m very new at experimenting with this platform and have been inspired to use it for my science project. I was recreating a project with an E-nose, and cloned that project data. When I began to collect data on my Seed Wio Terminal unfortunately I was guided to write all axes points with an _
This _ made it so when I try to flash the device it does not work I believe properly with the Wio Terminal.
I ran the original public project I cloned and it works fine. I also found that when I started the project over again with axes that did NOT include _ that the new firmware somewhat flashed ok to the Wio. terminal.
Question #1 is there a way for me to transfer all of the collected data from my old project to the new project when the 4 axes are written differently? For Example Nitrogen_Dioxide vs. Nitrogen Dioxide

Question #2 is there a way to rename my samples without affecting data collection? When I tried to change the sample/label name edge impulse treated it like a new sample

Project #73851

Thank you in advance

Hello @Calebkododo,

Question #1 is there a way for me to transfer all of the collected data from my old project to the new project when the 4 axes are written differently?

You can easily export your data from your old project to restore it in a new project.
Example:

The name of the samples and the labels will be the same but you can change it afterward:

Question #2 is there a way to rename my samples without affecting data collection?

To change the labels of your samples do the following for each class that you want to rename.
Example:

What do you mean by “without affecting data collection”?

Regards,

Louis

Dear Mr. Louis,

Thank you so much for your response. I very much appreciate your help.

I apologize ill try to be more specific. In regards to question #1. I believe I can import the data, but my concern is I assigned 4 axes sensors for smell detection, and if I export from the old project will it import the old axes on my new project, or will the export use the axes of the current project assigned?

#2. "What do you mean by “without affecting data collection.”
I attempted to change the names of one of the samples, and instead of simply just changing the name in data acquisition it treated it like a new sample., between training and testing data.

I hope that makes sense. Again thank you for helping me, I am a student, and I’m just beginning to learn and understand this.

Thank you,

Caleb

Oh ok, I see what you mean!

No at the moment, there is no easy way to rename the axis.
What I would do is, export all the data which will be files in a json format, write a small script to find and replace Nitrogen_Dioxide to Nitrogen Dioxide and do that for every labels.

Regards,

Louis

Here is a small script I wrote for you, just place it in your parent of your export (where there is the training and testing folders):

and execute the script doing:

python3 replace_axis.py --input training --old_axis accX --new_axis acc_X
#!/usr/bin/env python
import argparse
import os
import glob
import json


def find_and_place(input, old_axis, new_axis):
    for filename in glob.glob(os.path.join(input, '*.json')):
        print(filename)
        with open(filename) as file:
            data = json.load(file)

            for item in data['payload']['sensors']:
                item['name']=item['name'].replace(old_axis, new_axis)
                
            with open(filename, 'w') as file:
                json.dump(data, file)

if __name__=="__main__":
    print("Find a replace labels") 
    a = argparse.ArgumentParser()
    a.add_argument("--input", help="input folder")
    a.add_argument("--old_axis", help="old axis name")
    a.add_argument("--new_axis", help="new axis name")
    args = a.parse_args()
    print(args)
    find_and_place(args.input, args.old_axis, args.new_axis)

#exemple: python3 replace_axis.py --input training --old_axis accX --new_axis acc_X

I hope that helps,

Regards,

Louis

Mr. Louis,

Thank you so much for all of your help. I really appreciate this.

Caleb

1 Like

Apologies for my delay! :smile: Regardless, I’m recording my opinion on question/answer #1.

In a similar situation here, the import process turned out to be very easy: just select the exported parent folder and it easily recognizes the division and labels.
However, I would like to suggest an interesting feature: sharing data between projects.
Excellent platform! Congratulations!