How to export annotation of image manual without image string base64

Hey so I still wanted the filename, so instead, I used the "path" which included the filename and created a new key > name. And then removed the image base64 hash key. It's not the cleanest, but it worked. Thanks!

from prodigy.components.db import connect

db = connect()

dataset = db.get_dataset("old_dataset")
        
def remove_img(d):
    d['name'] = d['path'].split('/')[-1]
    return {k: v for k, v in d.items() if k != 'image'}

new_examples = [remove_img(e) for e in dataset]
db.add_dataset("new_dataset")
db.add_examples(new_examples, ["new_dataset"])
1 Like