GithubHelp home page GithubHelp logo

labelpandas's People

Contributors

ezekielemerson avatar raphaeljafrilb avatar tmorrowalgorithmia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

labelpandas's Issues

KeyError: 'mask' - client.export_to_table

I'm trying to export a dataset to a dataframe. I'm using the boilerplate code from the example notebook labelpandas-export.ipynb.

The code I"m running is:

df = client.export_to_table( project=project_id, include_performance=True, include_agreement=True, include_metadata=True, mask_method="png", verbose=True )

Here's the error:

Exporting labels from Labelbox for project with ID clr7vo5oc0be6072qacc5cwp0
Export complete: 5 labels exported
Flattening labels...

KeyError Traceback (most recent call last)
in <cell line: 1>()
----> 1 df = client.export_to_table(
2 project=project_id,
3 include_performance=True,
4 include_agreement=True,
5 include_metadata=True,

2 frames
/usr/local/lib/python3.10/dist-packages/labelbase/annotate.py in flatten_label(client, label_dict, ontology_index, datarow_id, mask_method, divider)
390 annotation_value = [array, [255,255,255]]
391 else:
--> 392 png = mask_to_bytes(client=client, input=obj['mask']["url"], datarow_id=datarow_id, method="url", color=[255,255,255], output="png")
393 annotation_value = [png, "null"]
394 if "classifications" in obj.keys():

KeyError: 'mask'

Thanks!

KeyError with df = client.export_to_table(project=project_id)


KeyError Traceback (most recent call last)
Cell In[8], line 1
----> 1 df = client.export_to_table(project=project_id)

File ~/opt/anaconda3/envs/research/lib/python3.10/site-packages/labelpandas/client.py:46, in Client.export_to_table(self, project, include_metadata, include_performance, include_agreement, verbose, mask_method, divider)
29 def export_to_table(
30 self, project,
31 include_metadata:bool=False, include_performance:bool=False, include_agreement:bool=False,
32 verbose:bool=False, mask_method:str="png", divider="///"):
33 """ Creates a Pandas DataFrame given a Labelbox Projet ID
34 Args:
35 project : Required (str / lablebox.Project) - Labelbox Project ID or lablebox.Project object to export labels from
(...)
44 divider : Optional (str) - String delimiter for schema name keys and suffix added to duplocate global keys
45 """
---> 46 flattened_labels_dict = export_and_flatten_labels(
47 client=self.lb_client, project=project,
48 include_metadata=include_metadata, include_performance=include_performance, include_agreement=include_agreement,
49 mask_method=mask_method, verbose=verbose, divider=divider
50 )
52 table = pd.DataFrame.from_dict(flattened_labels_dict)
54 if verbose:

File ~/opt/anaconda3/envs/research/lib/python3.10/site-packages/labelbase/downloader.py:59, in export_and_flatten_labels(client, project, include_metadata, include_performance, include_agreement, verbose, mask_method, divider)
51 if not label['Skipped']:
52 flat_label = {
53 "global_key" : label["Global Key"],
54 "row_data" : label["Labeled Data"],
(...)
57 "external_id" : label["External ID"]
58 }
---> 59 res = flatten_label(label_dict=label, ontology_index=ontology_index, schema_to_name_path=schema_to_name_path, mask_method=mask_method, divider=divider)
60 for key, val in res.items():
61 flat_label[f"annotation{divider}{str(key)}"] = val

File ~/opt/anaconda3/envs/research/lib/python3.10/site-packages/labelbase/annotate.py:117, in flatten_label(label_dict, ontology_index, schema_to_name_path, mask_method, divider)
115 annotation_value = [array, [255,255,255]]
116 else:
--> 117 png = mask_to_bytes(input=obj["instanceURI"], method="url", color=[255,255,255], output="png")
118 annotation_value = [png, "null"]
119 if "classifications" in obj.keys():

KeyError: 'instanceURI'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.