def setUp(self): self.api = AnnotationTypesApi() # noqa: E501 self.team_api = TeamsApi() self.image_sets_api = ImageSetsApi() self.product_api = ProductsApi() # create dummy team, image_sets and product teams = self.team_api.list_teams(name="test_annotation_type") if teams.count == 0: team = Team(name="test_annotation_type") team = self.team_api.create_team(body=team) else: team = teams.results[0] image_sets = self.image_sets_api.list_image_sets(name="test_annotation_type") if image_sets.count == 0: image_set = ImageSet(name="test_annotation_type", team=team.id) image_set = self.image_sets_api.create_image_set(body=image_set) else: image_set = image_sets.results[0] products = self.product_api.list_products(name="test_annotation_type") if products.count == 0: product = Product(name="test_annotation_type", imagesets=[image_set.id], team=team.id) product = self.product_api.create_product(body=product) else: product = products.results[0] self.team = team self.image_set = image_set self.product = product
def setUp(self): self.api = ImageSetsApi() # noqa: E501 self.team_api = TeamsApi() # create dummy team teams = self.team_api.list_teams(name="test_image_sets") if len(teams.results) == 0: team = Team(name="test_image_sets") team = self.team_api.create_team(body=team) else: team = teams.results[0] self.team = team
def setUp(self): self.api = AnnotationsApi() # noqa: E501 self.team_api = TeamsApi() self.image_sets_api = ImageSetsApi() self.product_api = ProductsApi() self.anno_type_api = AnnotationTypesApi() self.image_api = ImagesApi() # create dummy team, image_sets, product, image and anno_type teams = self.team_api.list_teams(name="test_annotation") if teams.count == 0: team = Team(name="test_annotation") team = self.team_api.create_team(body=team) else: team = teams.results[0] image_sets = self.image_sets_api.list_image_sets(name="test_annotation") if image_sets.count == 0: image_set = ImageSet(name="test_annotation", team=team.id) image_set = self.image_sets_api.create_image_set(body=image_set) else: image_set = image_sets.results[0] products = self.product_api.list_products(name="test_annotation") if products.count == 0: product = Product(name="test_annotation", imagesets=[image_set.id], team=team.id) product = self.product_api.create_product(body=product) else: product = products.results[0] annotation_types = self.anno_type_api.list_annotation_types(name="test_annotation") if annotation_types.count == 0: annotation_type = AnnotationType(name="test_annotation", vector_type=int(AnnotationType.VECTOR_TYPE.BOUNDING_BOX), product=product.id) annotation_type = self.anno_type_api.create_annotation_type(body=annotation_type) else: annotation_type = annotation_types.results[0] images = self.image_api.list_images(name="Eosinophile.png") if images.count == 0: file_path = "exact_sync/v1/test/images/Eosinophile.png" image_type = 0 images = self.image_api.create_image(file_path=file_path, image_type=image_type, image_set=image_set.id) image = images.results[0] else: image = images.results[0] self.team = team self.image_set = image_set self.product = product self.annotation_type = annotation_type self.image = image
def setUp(self): self.api = ImagesApi() # noqa: E501 self.team_api = TeamsApi() self.image_sets_api = ImageSetsApi() # create dummy team and image_sets teams = self.team_api.list_teams(name="test_images") if teams.count == 0: team = Team(name="test_images") team = self.team_api.create_team(body=team) else: team = teams.results[0] image_sets = self.image_sets_api.list_image_sets(name="test_images") if image_sets.count == 0: image_set = ImageSet(name="test_images", team=team.id) image_set = self.image_sets_api.create_image_set(body=image_set) else: image_set = image_sets.results[0] self.team = team self.image_set = image_set