A spreadsheet is an easy way to keep track of the experimental variables associated with your data. This examples goes through how to:
- Export any existing metadata from a dataset to a csv file
- Edit key-value metadata to the csv file
- Attach the updated csv file
- Add the key-value pairs to images from the csv file
In this example we will be using the guess-who images which can be downloaded from add repo location.
1. Export key-value metadata
a. Select the dataset
b. Select the script by clicking on the Run Script
icon and navigate to
MIF > Key Val to csv...
c. Click Run Script
. The script will already have the dataset ID filled in from the selected dataset. You can select multiple datasets by holding shift or add other IDs in the box. The script will say Done
and have a green tick when it has run.
d. Click the attachment to download it.
The dataset now has an attachment in the righthand pane (you may need to press the Refresh
button . The attachment is the name of dataset followed by
_metadata_out.csv
.
2. Edit the csv in Excel
a. Click the filename to download it to your Downloads
folder.
b. Open the file in Excel. The file will have a single column with filename
at the top and the names of the images below it. If this is a new dataset the rest of the spreadsheet will be empty.
c. Add the Key-Value metadata Keys go across the page in the first column. Fill in the values for each filename in the corresponding row and column below. Leave the cell empty if the image doesn't have a key-value associated with it.
d. Save the spreadsheet as .csv. Excel will warn you about loosing features, this is alright.
3. Attach the updated csv file
a. Select the Dataset.
b. Under Attachments
click the Attach a file
button .
c. Click Choose File
and select the .csv file you just created then press Accept
d. There will now be two .csv in the Attachments; the original export of just the filenames and version you edited in Excel.
4. Add key-values pair from the csv
a. Select the script by clicking on the Run Script
icon and navigate to
MIF > Key Val from csv...
b. Click Run Script
. The dataset ID should already be filled in for you.
c. When the script has run there will be green tick. The
d. You can now see the key-value pairs that have been added to the image by clicking refresh, selecting an in the dataset and folding the Key-Value Pairs
pane down: