Ability to bulk delete labels via Python SDK or UI

I was recently uploading ground truth labels to an Annotation project and accidentally uploaded them twice. This resulted in two label entries existing for each image. As our project isn’t using consensus, this doesn’t make much sense.

We also noticed that some of the ground truth labels needed fixing, so we are adjusting them now. However, having two label entries per image is making it confusing.

As a result, I wanted the ability to delete all labels associated with one ground truth upload job via either the Python SDK or the Web UI.

Thank you for the help :smile:

Hi @kyle ,

There are some ways you can do the deletion, if you have imported labels (ground truth),

  • Via the UI :

Project → Automation tab → select the import, ellipsis

  • Via SDK :

method bulk_import_requests() will return a list of import, select the one you would like to remove.

project = client.get_project("<PROJECT_ID>")
importList = []
for imports in project.bulk_import_requests():
  importList.append(imports)
#importList[0] 
#importList[0].delete()  #This will delete all pre-annotations uploaded via MAL

There is also bulk_delete(labels) in the SDK.

Many thanks,
PT

Thanks for the help.

I noticed that the bulk import requests only contained pre-labels imported as MAL jobs. I am not able to find any of the bulk imports I did with lb.LabelImport.create_from_objects().

Was there any way to list these and delete these?

For label, you can delete and requeue via the UI :

Or via SDK :
https://labelbox-python.readthedocs.io/en/latest/index.html#labelbox.schema.label.Label.bulk_delete

:warning: As always, if you are deleting stuff, make sure you are deleting the right record.

Many thanks,
PT