|
| 1 | +import time |
1 | 2 | import uuid |
2 | | -from typing import Union |
| 3 | +from typing import Tuple, Type, Union |
3 | 4 |
|
4 | | -from labelbox.schema.model_run import ModelRun |
5 | | -from labelbox.schema.ontology import Ontology |
6 | | -from labelbox.schema.project import Project |
7 | 5 | import pytest |
8 | | -import time |
9 | 6 | import requests |
10 | | - |
11 | | -from labelbox import parser, MediaType, OntologyKind |
12 | | -from labelbox import Client, Dataset |
13 | | - |
14 | | -from typing import Tuple, Type |
15 | | -from labelbox.schema.annotation_import import LabelImport, AnnotationImportState |
16 | 7 | from pytest import FixtureRequest |
17 | 8 |
|
| 9 | +from labelbox import Client, Dataset, MediaType, OntologyKind, parser |
| 10 | +from labelbox.schema.annotation_import import AnnotationImportState, LabelImport |
| 11 | +from labelbox.schema.model_run import ModelRun |
| 12 | +from labelbox.schema.ontology import Ontology |
| 13 | +from labelbox.schema.project import Project |
| 14 | + |
18 | 15 | """ |
19 | 16 | The main fixtures of this library are configured_project and configured_project_by_global_key. Both fixtures generate data rows with a parametrize media type. They create the amount of data rows equal to the DATA_ROW_COUNT variable below. The data rows are generated with a factory fixture that returns a function that allows you to pass a global key. The ontologies are generated normalized and based on the MediaType given (i.e. only features supported by MediaType are created). This ontology is later used to obtain the correct annotations with the prediction_id_mapping and corresponding inferences. Each data row will have all possible annotations attached supported for the MediaType. |
20 | 17 | """ |
@@ -1256,35 +1253,6 @@ def line_inference(prediction_id_mapping): |
1256 | 1253 | return lines |
1257 | 1254 |
|
1258 | 1255 |
|
1259 | | -@pytest.fixture |
1260 | | -def line_inference_v2(prediction_id_mapping): |
1261 | | - lines = [] |
1262 | | - for feature in prediction_id_mapping: |
1263 | | - if "line" not in feature: |
1264 | | - continue |
1265 | | - line = feature["line"].copy() |
1266 | | - line_data = { |
1267 | | - "groupKey": "axial", |
1268 | | - "segments": [ |
1269 | | - { |
1270 | | - "keyframes": [ |
1271 | | - { |
1272 | | - "frame": 1, |
1273 | | - "line": [ |
1274 | | - {"x": 147.692, "y": 118.154}, |
1275 | | - {"x": 150.692, "y": 160.154}, |
1276 | | - ], |
1277 | | - } |
1278 | | - ] |
1279 | | - }, |
1280 | | - ], |
1281 | | - } |
1282 | | - line.update(line_data) |
1283 | | - del line["tool"] |
1284 | | - lines.append(line) |
1285 | | - return lines |
1286 | | - |
1287 | | - |
1288 | 1256 | @pytest.fixture |
1289 | 1257 | def point_inference(prediction_id_mapping): |
1290 | 1258 | points = [] |
@@ -1796,7 +1764,6 @@ def annotations_by_media_type( |
1796 | 1764 | polygon_inference, |
1797 | 1765 | rectangle_inference, |
1798 | 1766 | rectangle_inference_document, |
1799 | | - line_inference_v2, |
1800 | 1767 | line_inference, |
1801 | 1768 | entity_inference, |
1802 | 1769 | entity_inference_index, |
@@ -1825,7 +1792,6 @@ def annotations_by_media_type( |
1825 | 1792 | text_inference_index, |
1826 | 1793 | entity_inference_index, |
1827 | 1794 | ], |
1828 | | - MediaType.Dicom: [line_inference_v2], |
1829 | 1795 | MediaType.Document: [ |
1830 | 1796 | entity_inference_document, |
1831 | 1797 | checklist_inference, |
|
0 commit comments