Skip to content

SP-23182 - remove example license #208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/run-smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,3 @@ jobs:
working-directory: example
env:
API_BASE_PATH: "https://nightly-api.regulaforensics.com"
TEST_LICENSE: ${{secrets.TEST_LICENSE}}
11 changes: 0 additions & 11 deletions example/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@

host = os.getenv("API_BASE_PATH", "https://api.regulaforensics.com")

# read optional local license file
if os.path.isfile('regula.license') and os.access('regula.license', os.R_OK):
with open("regula.license", "rb") as f:
print("Found local license file. Using it for performing request...")
regula_license = f.read()

with open("WHITE.jpg", "rb") as f:
white_page_0 = f.read()

Expand All @@ -26,11 +20,6 @@
}
params = ProcessParams(alreadyCropped=True, scenario=Scenario.FULLPROCESS)

# Add license to request
# request = RecognitionRequest(system_info=ProcessSystemInfo(license=base64.b64encode(regula_license).decode()), process_params=params, images=[
# RecognitionImage(image=white_page_0, light_index=Light.WHITE, page_index=0),
# ])

request = RecognitionRequest(process_params=params, images=[
RecognitionImage(image=white_page_0, light_index=Light.WHITE, page_index=0),
# RecognitionImage(image=ir_page_0, light_index=Light.IR, page_index=0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ class ChosenDocumentType(BaseModel):
"""
Contains information about one document type candidate
""" # noqa: E501
document_name: StrictStr = Field(description="Document name", alias="DocumentName")
document_name: Optional[StrictStr] = Field(default=None, description="Document name", alias="DocumentName")
id: StrictInt = Field(description="Unique document type template identifier (Regula's internal numeric code)", alias="ID")
p: Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]] = Field(description="A measure of the likelihood of correct recognition in the analysis of this type of document", alias="P")
rotated180: StrictInt = Field(description="true if the document of the given type is rotated by 180 degrees", alias="Rotated180")
rfid_presence: RfidLocation = Field(alias="RFID_Presence")
fdsid_list: FDSIDList = Field(alias="FDSIDList")
fdsid_list: Optional[FDSIDList] = Field(default=None, alias="FDSIDList")
necessary_lights: StrictInt = Field(description="Combination of lighting scheme identifiers (Light enum) required to conduct OCR for this type of document", alias="NecessaryLights")
check_authenticity: StrictInt = Field(description="Set of authentication options provided for this type of document (combination of Authenticity enum)", alias="CheckAuthenticity")
uv_exp: StrictInt = Field(description="The required exposure value of the camera when receiving images of a document of this type for a UV lighting scheme", alias="UVExp")
Expand Down
4 changes: 2 additions & 2 deletions regula/documentreader/webclient/gen/models/one_candidate.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ class OneCandidate(BaseModel):
"""
Contains information about one document type candidate
""" # noqa: E501
document_name: StrictStr = Field(description="Document name", alias="DocumentName")
document_name: Optional[StrictStr] = Field(default=None, description="Document name", alias="DocumentName")
id: StrictInt = Field(description="Unique document type template identifier (Regula's internal numeric code)", alias="ID")
p: Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]] = Field(description="A measure of the likelihood of correct recognition in the analysis of this type of document", alias="P")
rotated180: StrictInt = Field(description="true if the document of the given type is rotated by 180 degrees", alias="Rotated180")
rfid_presence: RfidLocation = Field(alias="RFID_Presence")
fdsid_list: FDSIDList = Field(alias="FDSIDList")
fdsid_list: Optional[FDSIDList] = Field(default=None, alias="FDSIDList")
necessary_lights: StrictInt = Field(description="Combination of lighting scheme identifiers (Light enum) required to conduct OCR for this type of document", alias="NecessaryLights")
check_authenticity: StrictInt = Field(description="Set of authentication options provided for this type of document (combination of Authenticity enum)", alias="CheckAuthenticity")
uv_exp: StrictInt = Field(description="The required exposure value of the camera when receiving images of a document of this type for a UV lighting scheme", alias="UVExp")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ class ProcessParams(BaseModel):
do_barcodes: Optional[List[InputBarcodeType]] = Field(default=None, description="Set the types of barcodes to process.", alias="doBarcodes")
strict_dl_category_expiry: Optional[StrictBool] = Field(default=None, description="Set to force DL categories expiry date to affect the overall status or not. As documents usually have their own date of expiry, which might be less or greater than category expiry date, this might be handy for specific cases.", alias="strictDLCategoryExpiry")
generate_alpha2_codes: Optional[StrictBool] = Field(default=None, description="Set to generate Alpha-2 codes for nationality and issuing state fields.", alias="generateAlpha2Codes")
__properties: ClassVar[List[str]] = ["generateDTCVC", "lcidFilter", "checkLiveness", "lcidIgnoreFilter", "oneShotIdentification", "useFaceApi", "faceApi", "doDetectCan", "imageOutputMaxHeight", "imageOutputMaxWidth", "scenario", "resultTypeOutput", "doublePageSpread", "generateDoublePageSpreadImage", "fieldTypesFilter", "dateFormat", "measureSystem", "imageDpiOutMax", "alreadyCropped", "customParams", "config", "log", "logLevel", "forceDocID", "matchTextFieldMask", "fastDocDetect", "updateOCRValidityByGlare", "checkRequiredTextFields", "returnCroppedBarcode", "imageQa", "strictImageQuality", "respectImageQuality", "forceDocFormat", "noGraphics", "depersonalizeLog", "multiDocOnImage", "shiftExpiryDate", "minimalHolderAge", "returnUncroppedImage", "mrzFormatsFilter", "forceReadMrzBeforeLocate", "parseBarcodes", "convertCase", "splitNames", "disablePerforationOCR", "documentGroupFilter", "processAuth", "deviceId", "deviceType", "deviceTypeHex", "ignoreDeviceIdFromImage", "documentIdList", "rfid", "checkAuth", "authParams", "mrzDetectMode", "generateNumericCodes", "strictBarcodeDigitalSignatureCheck", "selectLongestNames", "doBarcodes", "strictDLCategoryExpiry", "generateAlpha2Codes"]
pdf_pages_limit: Optional[StrictInt] = Field(default=None, description="Limits the number of pages to be processed from a PDF file.", alias="pdfPagesLimit")
__properties: ClassVar[List[str]] = ["generateDTCVC", "lcidFilter", "checkLiveness", "lcidIgnoreFilter", "oneShotIdentification", "useFaceApi", "faceApi", "doDetectCan", "imageOutputMaxHeight", "imageOutputMaxWidth", "scenario", "resultTypeOutput", "doublePageSpread", "generateDoublePageSpreadImage", "fieldTypesFilter", "dateFormat", "measureSystem", "imageDpiOutMax", "alreadyCropped", "customParams", "config", "log", "logLevel", "forceDocID", "matchTextFieldMask", "fastDocDetect", "updateOCRValidityByGlare", "checkRequiredTextFields", "returnCroppedBarcode", "imageQa", "strictImageQuality", "respectImageQuality", "forceDocFormat", "noGraphics", "depersonalizeLog", "multiDocOnImage", "shiftExpiryDate", "minimalHolderAge", "returnUncroppedImage", "mrzFormatsFilter", "forceReadMrzBeforeLocate", "parseBarcodes", "convertCase", "splitNames", "disablePerforationOCR", "documentGroupFilter", "processAuth", "deviceId", "deviceType", "deviceTypeHex", "ignoreDeviceIdFromImage", "documentIdList", "rfid", "checkAuth", "authParams", "mrzDetectMode", "generateNumericCodes", "strictBarcodeDigitalSignatureCheck", "selectLongestNames", "doBarcodes", "strictDLCategoryExpiry", "generateAlpha2Codes", "pdfPagesLimit"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -231,7 +232,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"selectLongestNames": obj.get("selectLongestNames"),
"doBarcodes": obj.get("doBarcodes"),
"strictDLCategoryExpiry": obj.get("strictDLCategoryExpiry"),
"generateAlpha2Codes": obj.get("generateAlpha2Codes")
"generateAlpha2Codes": obj.get("generateAlpha2Codes"),
"pdfPagesLimit": obj.get("pdfPagesLimit")
})
return _obj

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,9 @@ class TextFieldType(int, Enum):
EF_CARD_ACCESS = 692
SHORT_FLIGHT_NUMBER = 693
AIRLINE_CODE = 694
FT_MVC_AGENCY = 695
FT_ISSUING_STATE_CODE_ALPHA2 = 696
FT_NATIONALITY_CODE_ALPHA2 = 697

@classmethod
def from_json(cls, json_str: str) -> Self:
Expand Down