Exemplo n.º 1
0
    async def create(
        self,
        name: str,
        license_type: SourceLicense = SourceLicense.BASIC,
        identify_facesize_threshold: int = 7000,
        use_pps_time: bool = False,
        manual_create_facesize_threshold: int = 25000,
        manual_create_on_ha: bool = False,
        manual_create_on_junk: bool = False,
        manual_identify_asm: bool = True,
        auto_create_persons: bool = False,
        auto_create_facesize_threshold: int = 25000,
        auto_create_check_blur: bool = True,
        auto_create_check_exposure: bool = True,
        auto_create_on_ha: bool = False,
        auto_create_on_junk: bool = False,
        auto_check_face_angle: bool = True,
        auto_check_liveness: bool = False,
        auto_create_liveness_only: bool = True,
        auto_identify_asm: bool = True,
        store_images_for_results: Union[Optional[List[str]],
                                        object] = sentinel,
    ) -> Response:
        data = request_dict_processing(locals(), ["self"])

        async with self.get_client() as client:
            return await client.post(url="/v1/sources/", json=data)
Exemplo n.º 2
0
    def update(
        self,
        id: int,
        name: str,
        license_type: Union[SourceLicense, object] = sentinel,
        identify_facesize_threshold: Union[int, object] = sentinel,
        use_pps_time: Union[bool, object] = sentinel,
        manual_create_facesize_threshold: Union[int, object] = sentinel,
        manual_create_on_ha: Union[bool, object] = sentinel,
        manual_create_on_junk: Union[bool, object] = sentinel,
        manual_identify_asm: Union[bool, object] = sentinel,
        auto_create_persons: Union[bool, object] = sentinel,
        auto_create_facesize_threshold: Union[int, object] = sentinel,
        auto_create_check_blur: Union[bool, object] = sentinel,
        auto_create_check_exposure: Union[bool, object] = sentinel,
        auto_create_on_ha: Union[bool, object] = sentinel,
        auto_create_on_junk: Union[bool, object] = sentinel,
        auto_check_face_angle: Union[bool, object] = sentinel,
        auto_check_liveness: Union[bool, object] = sentinel,
        auto_create_liveness_only: Union[bool, object] = sentinel,
        auto_identify_asm: Union[bool, object] = sentinel,
        store_images_for_results: Union[List[str], object] = sentinel,
    ) -> Response:
        data = request_dict_processing(locals(), ["id", "self"])

        with self.get_client() as client:
            return client.patch(url=f"/v1/sources/{id}/", json=data)
Exemplo n.º 3
0
    def update(
        self,
        exact: float = DEFAULT_EXACT_THRESHOLD,
        ha: float = DEFAULT_HA_THRESHOLD,
        junk: float = DEFAULT_JUNK_THRESHOLD,
    ) -> Response:
        data = request_dict_processing(locals(), ["self"])

        with self.get_client() as client:
            return client.patch(url="/v1/settings/thresholds/", data=data)
Exemplo n.º 4
0
    async def create(
        self,
        name: str,
        http_method: HttpMethod,
        destination_url: str,
        is_active: bool = True,
        moods: Union[List[EntryMood], object] = sentinel,
        results: Union[List[EntryResult], object] = sentinel,
        liveness: Union[List[EntryLiveness], object] = sentinel,
        age_from: Union[int, object] = sentinel,
        age_to: Union[int, object] = sentinel,
        sex: Union[List[Sex], object] = sentinel,
        sources: Union[List[int], object] = sentinel,
        persons_groups: Union[List[int], object] = sentinel,
    ) -> Response:
        data = request_dict_processing(locals(), ["self"])

        async with self.get_client() as client:
            return await client.post(url="/v1/notifications/", json=data)
Exemplo n.º 5
0
def test_request_dict_processing_has_exclude():
    data = {"one": 1, "two": sentinel, "self": 3, "three": [1, 2, 3]}

    result = request_dict_processing(data, ["three"])
    assert result == {"one": 1}
Exemplo n.º 6
0
    async def create_by_entry(self, id: int, create_on_ha: bool,
                              create_on_junk: bool) -> Response:
        data = request_dict_processing(locals(), ["self"])

        async with self.get_client() as client:
            return await client.post(url="/v1/persons/entry/", json=data)