Ejemplo n.º 1
0
 def __init__(self, client):
     self.image_sets_api = ImageSetsApi(client)
     self.annotations_api = AnnotationsApi(client)
     self.annotation_types_api = AnnotationTypesApi(client)
     self.images_api = ImagesApi(client)
     self.product_api = ProductsApi(client)
     self.team_api = TeamsApi(client)
     self.users_api = UsersApi(client)
Ejemplo n.º 2
0
    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
Ejemplo n.º 3
0
    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