-
Notifications
You must be signed in to change notification settings - Fork 68
annotation import #163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
annotation import #163
Conversation
…into ms/annotation-import
…into ms/annotation-import
awu-labelbox
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm, I only saw non-functionality related comments
| data = json.dumps({ | ||
| 'query': query, | ||
| 'variables': params | ||
| }).encode('utf-8') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If params is None, would it set the value of variables to undefined? Is that OK here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this should be fine. Here is a minimal example you can try that works without setting params.
from labelbox import Client
client = Client()
client.execute(""" query { organization {id} }""")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm -- just a reminder to remove/stub out local API_KEY and ENDPOINT in the notebook.
Thanks for making the changes!
| logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| class AnnotationImport(DbObject): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice! glad this name made its way into the SDK, also.
labelbox/schema/annotation_import.py
Outdated
|
|
||
| @classmethod | ||
| def _build_import_predictions_query(cls, file_args: str, vars: str): | ||
| query_str = """mutation testPredictionImportsPyApi($parent_id : ID!, $name: String!, $predictionType : PredictionType!, %s) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be called testPredictionImportsPyPyi still? Maybe ModelErrorAnalysisPredictionImport?
labelbox/schema/annotation_import.py
Outdated
| %s : $parent_id | ||
| name: $name | ||
| %s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like its not a big deal, but i think these could be indented (and below)
| return cls._create_from_objects(client, model_run_id, name, predictions) | ||
|
|
||
|
|
||
| class MALPredictionImport(AnnotationImport): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im curious why we need this? I dont think were going to be allowing MAL imports via SDK through this mutation for a little while.
labelbox/schema/enums.py
Outdated
| class BulkImportRequestState(Enum): | ||
| """ State of the import job when importing annotations (RUNNING, FAILED, or FINISHED). | ||
| This object is deprecated. Please use PredictionImportState instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you mean AnnotationImportState.
| FINISHED = "FINISHED" | ||
|
|
||
|
|
||
| class ImportType(Enum): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish I'd called this variable ImportType rather than prediction type everywhere :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some nits but looks amazing to me.
No description provided.