Skip to content
Merged
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

# Version 3.23.3 (2022-06-23)

## Fix
* Import for `numpy` has been adjusted to work with numpy v.1.23.0

# Version 3.23.2 (2022-06-15)
## Added
* `Data Row` object now has a new field, `metadata`, which returns metadata associated with data row as a list of `DataRowMetadataField`
Expand Down
145 changes: 144 additions & 1 deletion examples/model_assisted_labeling/mal_basics.ipynb
Original file line number Diff line number Diff line change
@@ -1,4 +1,147 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "db768cda",
"metadata": {
"id": "db768cda"
},
"source": [
"<td>\n",
" <a target=\"_blank\" href=\"https://labelbox.com\" ><img src=\"https://labelbox.com/blog/content/images/2021/02/logo-v4.svg\" width=256/></a>\n",
"</td>"
]
},
{
"cell_type": "markdown",
"id": "cb5611d0",
"metadata": {
"id": "cb5611d0"
},
"source": [
"<td>\n",
"<a href=\"https://colab.research.google.com/github/Labelbox/labelbox-python/blob/develop/examples/model_assisted_labeling/mal_basics.ipynb\" target=\"_blank\"><img\n",
"src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"></a>\n",
"</td>\n",
"\n",
"<td>\n",
"<a href=\"https://github.com/Labelbox/labelbox-python/tree/develop/examples/model_assisted_labeling/mal_basics.ipynb\" target=\"_blank\"><img\n",
"src=\"https://img.shields.io/badge/GitHub-100000?logo=github&logoColor=white\" alt=\"GitHub\"></a>\n",
"</td>"
]
},
{
"cell_type": "markdown",
"id": "fundamental-failure",
"metadata": {
"id": "fundamental-failure"
},
"source": [
"# Annotation Imports\n",
"* This notebook is a high level introduction demonstrating multiple ways to upload your annotations. This will cover the following:\n",
" * Model-assisted labeling - used to provide pre-annotated data for your labelers. This will enable a reduction in the total amount of time to properly label your assets. Model-assisted labeling does not submit the labels automatically, and will need to be reviewed by a labeler for submission.\n",
" * Label Import - used to provide ground truth labels. These can in turn be used and compared against prediction labels, or used as benchmarks to see how your labelers are doing.\n",
"\n",
"\n",
"* For complete examples see image_mal.ipynb or ner_mal.ipynb"
]
},
{
"cell_type": "markdown",
"id": "registered-parts",
"metadata": {
"id": "registered-parts"
},
"source": [
"* For information on what types of annotations are supported per data type, refer to this documentation:\n",
" * https://docs.labelbox.com/docs/model-assisted-labeling#option-1-import-via-python-annotation-types-recommended"
]
},
{
"cell_type": "markdown",
"id": "legislative-violence",
"metadata": {
"id": "legislative-violence"
},
"source": [
"* Notes:\n",
" * If you are importing more than 1,000 mask annotations at a time, consider submitting separate jobs, as they can take longer than other annotation types to import.\n",
" * Wait until the import job is complete before opening the Editor to make sure all annotations are imported properly."
]
},
{
"cell_type": "markdown",
"id": "70072299-2ffe-4ea3-9af1-410d9bfd18cc",
"metadata": {
"id": "70072299-2ffe-4ea3-9af1-410d9bfd18cc"
},
"source": [
"# Installs"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "pointed-disability",
"metadata": {
"id": "pointed-disability"
},
"outputs": [],
"source": [
"!pip install -q 'labelbox[data]'"
]
},
{
"cell_type": "markdown",
"id": "a5c271de-1006-400e-a5bb-d466b833b734",
"metadata": {
"id": "a5c271de-1006-400e-a5bb-d466b833b734"
},
"source": [
"# Imports"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "guided-arthritis",
"metadata": {
"id": "guided-arthritis"
},
"outputs": [],
"source": [
"from labelbox.schema.ontology import OntologyBuilder, Tool\n",
"from labelbox import Client, LabelingFrontend, LabelImport, MALPredictionImport\n",
"from labelbox.data.annotation_types import (\n",
" Label, ImageData, ObjectAnnotation, Rectangle, Point, Radio,\n",
" ClassificationAnnotation, ClassificationAnswer\n",
")\n",
"from labelbox.data.serialization import NDJsonConverter\n",
"import uuid\n",
"import json"
]
},
{
"cell_type": "markdown",
"id": "7ff330d7",
"metadata": {
"id": "7ff330d7"
},
"source": [
"# API Key and Client\n",
"Provide a valid api key below in order to properly connect to the Labelbox Client."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "preliminary-benchmark",
"metadata": {
"id": "preliminary-benchmark",
"outputId": "8cf16a44-d0b8-477f-b361-43865b2fc572"
},

"outputs": [
{
"name": "stderr",
"output_type": "stream",
Expand Down Expand Up @@ -371,4 +514,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}
2 changes: 1 addition & 1 deletion labelbox/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name = "labelbox"
__version__ = "3.23.2"
__version__ = "3.23.3"

from labelbox.client import Client
from labelbox.schema.project import Project
Expand Down
8 changes: 6 additions & 2 deletions labelbox/data/annotation_types/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,12 @@ def validate(cls, val, field: ModelField):
return val


if version.parse(np.__version__) >= version.parse('1.22.0'):
if version.parse(np.__version__) >= version.parse('1.23.0'):
from numpy._typing import _GenericAlias
TypedArray = _GenericAlias(_TypedArray, (Any, DType))
elif version.parse('1.22.0') <= version.parse(
np.__version__) < version.parse('1.23.0'):
from numpy.typing import _GenericAlias
TypedArray = _GenericAlias(_TypedArray, (Any, DType))
else:
TypedArray = _TypedArray[Any, DType]
TypedArray = _TypedArray[Any, DType]