Parameters
In all examples below replace localhost with the IP address of the machine running the docker container, if not the same one.
Shipping Container Images on Premise supports the same REST parameters as Shipping Container Images API. The app also exposes Swagger UI at http://localhost:8001/docs where you can try out and see the parameters in action.
Parameters could be combined in a curl request like this:
curl -F 'image=@container.jpg' -F 'min_detection_score=0.2' -F 'min_ocr_score=0.6' -F 'camera_id=1' -F 'timestamp=2023-01-01T12:00:00' http://localhost:8001/predict/
All parameters, except image, are optional. Below is a short description.
image
Path to image file to upload to the app for analysis. Must start with @ symbol. For example, image=@/tmp/container.jpg.
min_detection_score
On the first stage of reading container information from an image, the algorithm detects regions of text and assigns them a confidence score between 0 and 1. The higher the score, the more confident the algorithm is that the region contains useful information. This parameter cuts off regions with a score below the specified value from the output. The default is min_detection_score = 0.2.
min_ocr_score
On the second stage of analyzing an image, the algorithm tries to read the text in the regions detected on the first stage, using our OCR technology. It produces different possible interpretations of the characters it can see and assigns each such interpretation a confidence score between 0 and 1. The higher the score, the more confident the algorithm is that this reading is correct. This parameter cuts off interpretations with a score below the specified value from the output. The default is min_ocr_score = 0.6.
camera_id
This parameter is used to identify the source that produced the image in case you have multiple sources querying the app. It will be simply included in the output and does not influence the recognition process.
timestamp
This parameter is used to identify time the image was taken to differentiate between different images. It will be simply included in the output and does not influence the recognition process.
config
Pass the config parameter as a JSON dictionary to adjust the engine configuration. Accepted values:
{"text_rule":"strict"}: Only accept the results that exactly match the default Container templates and templates, specified in"text_formats". For example, if Container ID is 3 letters and 3 numbers, the value ABC1234 will be discarded.{"text_formats":["..."]}: List of regular expressions. They are used to guide the engine's predictions. For example, if you know the output is generally 3 digits and 2 letters, you would use -{"text_formats":["[0-9][0-9][0-9][A-Z][A-Z]"]}. More information about the format. The engine may not follow the format when the predictions are too different. If you want to exactly match the regexp, you should also use"text_rule":"strict"(see above).
New in version 0.7.0.