i90 I90 GOST Container & plate recognition offline

I90 GOST User Guide

Version 1.8.0 · Windows service or Linux (systemd) service · CPU only

I90 GOST reads container numbers, container weight tables and Turkish vehicle plates from photos. You send a photo over HTTP and receive JSON.

Each request runs three steps: the number or plate is located in the photo, the located region is read with OCR, and the text is checked against the rules of the format (ISO 6346 for containers, the Turkish civil plate format for plates).

Requests are processed one at a time. Several clients can call the service at once; their requests wait in line.

Quick start

The service listens on port 8000 by default. From the server itself:

curl -X POST "http://localhost:8000/api/get_Plate/?imgout=false" -F "file=@truck.jpg"

From another machine replace localhost with the server name or address. You can also try photos interactively on the Test page.

Every reading endpoint takes the photo as a multipart form field named file.

Endpoints

EndpointWhat it returns
POST /api/get_Plate/ The plate of the vehicle in the photo. Also accepts an already cropped plate.
POST /api/get_Container_ID/ The container number and the size/type code. The fastest container endpoint.
POST /api/get_Container_Info/ The container number, size/type code and the weights (max gross, tare, payload).
POST /api/get_RAWOCR/ All text found in the photo, without any interpretation. For diagnostics.
GET /api/health {"status": "healthy"} when the models are loaded; HTTP 503 otherwise.
POST /api/get_info_app/ Name, version and build of the running service.
GET /api/license/status License validity, expiry date, request usage and this machine's code.
GET /api/current_settings/ The active settings, including the upload limits.

Query parameters

ParameterDefaultMeaning
imgouttrue Include the image that was given to OCR in the response (images.crop, base64 JPEG). Set it to false in production; the responses are much smaller.
singlelinetrue get_RAWOCR only. true: one joined string. false: a list of lines.

The response envelope

All reading endpoints answer with the same outer structure:

{
  "detections": [ ... ],          // one item per number or plate found; empty if none
  "result": "success",            // "error" when the photo was rejected
  "filename": "truck.jpg",
  "processing_time": 0.31,        // seconds
  "message": "Plate detected",
  "error": "",
  "timestamp": "2026-11-13 12:40:02",
  "timing": "..."                 // step timings, for diagnostics
}

An empty detections list with "result": "success" means the photo was processed but nothing was found.

Plate response

{
  "class": "plate",
  "confidence": 0.91,             // how sure the service is that this region is a plate
  "box": {"x1": 960, "y1": 1462, "x2": 1246, "y2": 1558},
  "skew_angle": 4.57,
  "plate": "59AFF682",            // empty when no valid plate was read
  "candidate": "",                // the text that was read, when it is not a valid plate
  "method": "predicted-ocr-basic",
  "ocr_confidence": 0.97          // how sure the OCR is about the characters
}
  • plate is filled only when the text matches the Turkish civil plate format (city code 01–81, then 1–3 letters, then 2–5 digits depending on the letter count).
  • When text was read but it is not a valid plate, plate is empty and the text is returned in candidate. Foreign plates end up here.
  • Photos up to 450 pixels high are treated as an already cropped plate; the whole photo is read.

The method field

method describes how the plate was read. It is informative; do not compare it with a fixed text. It is built from a prefix, a step and optional suffixes:

PartMeaning
predicted-The plate was located in a vehicle photo.
predicted-zoomed-Located on a second pass over the lower-left part of the photo.
raw-The photo was a cropped plate.
ocr-basicRead on the first attempt.
ocr-enhancedRead after contrast enhancement.
ocr-enhanced+advancedRead by the larger OCR model.
+spacing, +verified A reading where B and 8 could be confused was resolved, from the spacing on the plate or by asking the larger model.
+partialThe plate was found inside a longer text line.
+noskewThe plate was read without skew correction, because the corrected image could not be used or gave no result.

Container response

{
  "class": "horizontal_container_id",
  "confidence": 0.90,             // how sure the service is that this region is a container number
  "box": {"x1": 1015, "y1": 143, "x2": 1573, "y2": 931},
  "filename": "door.jpg",
  "processing_time": 0.89,
  "skew_angle": 10.87,
  "method": "predicted-ocrbasic",
  "containerinfo": {
    "id": "MSMU7166469",
    "owner": "MSMU",
    "serial": "716646",
    "check_digit": "9",
    "confidence": 1.0,            // 1.0 = check digit read from the photo and correct
    "maxgross": 32500,            // kg; null when not read. get_Container_Info only
    "payload": 28660,
    "tare": 3840,
    "typecode": "45G1",
    "typelength": "40 ft (12192 mm)",
    "typeheightwidth": "9 ft 6 in (2896 mm) - High Cube",
    "typegroup": "...",
    "typedescription": "...",
    "owner_name": "MSC- MEDITERRANEAN SHIPPING COMPANY S.A.",
    "owner_country": "Switzerland",
    "owner_country_code": "CH",
    "owner_city": "GENEVE",
    "owner_street": "CHEMIN RIEU 12-14",
    "owner_post_code": "CH 1208",
    "owner_website": "www.msc.com",
    "other": ["MSMU", "716646", "9", "45G1", "32500KGS", "..."]   // every text that was read
  }
}
  • id is the 11-character number: owner code, six-digit serial and check digit. When only the owner code could be read, id holds just those four letters.
  • Weights are in kilograms and are returned by get_Container_Info only. They are read from the weight table on the door; the service cross-checks the KG and LBS rows and the rule max gross − tare = payload.
  • The owner fields are filled from the registered owner list when the owner code is known.
  • box in get_Container_Info is the enlarged region that also covers the weight table (in the photo after it has been rotated by skew_angle).

Reading the confidence values

The responses carry different confidence values. They answer different questions.

FieldQuestion it answers
Plate: confidenceIs this region a plate? It says nothing about the characters.
Plate: ocr_confidence How sure is the OCR about the characters (0–1)? When the plate was read in several pieces, the weakest piece counts.
Container: confidence (outer)Is this region a container number?
Container: containerinfo.confidence Was the number confirmed by its check digit? See below.

Container numbers: confirmed or not

A container number carries its own proof: the last digit is calculated from the first ten characters.

  • containerinfo.confidence = 1.0 — the check digit was read from the photo and it matches. The number can be trusted.
  • Below 1.0 — the check digit could not be read, or did not match what was read. In this case the last digit of id is the calculated digit, so the number looks valid but one of its characters may be wrong. Treat it as unconfirmed.
  • 0.0 — the owner code is not in the registered owner list.

Plates: low OCR confidence

A plate with a valid format is not necessarily the right plate: a misread letter usually still gives a valid plate. In our reference photos the known misreadings were among the readings with ocr_confidence below 0.8. Consider reviewing such results by hand.

Errors and limits

LimitValue
File size2 MB
File types.png, .jpg, .jpeg
ConcurrencyOne photo is processed at a time; other requests wait.

The limits above are read from the running service.

Rejected photos (HTTP 400)

{
  "detections": [],
  "result": "error",
  "filename": "document.pdf",
  "processing_time": 0,
  "message": "failed",
  "error": "Invalid file type. Allowed: .png,.jpg,.jpeg"
}
errorCause
File too large. Max size: …MBThe photo exceeds the size limit.
Invalid file type. Allowed: …The file extension is not accepted.
Invalid image file signatureThe content is not a JPEG or PNG image.
No file uploadedThe file field is missing or has no file name.

When the license is not valid the reading endpoints answer with HTTP 403 and the same structure, with "message": "license" and the reason in error (see License).

A request without the file field is answered with HTTP 422. HTTP 500 indicates an unexpected failure; the details are in the service log.

License

The service needs a license file (license.lic) issued by Inoventa. It is checked on the server itself; no internet connection is needed. The file is installed once and is kept across updates.

A license may carryMeaning
Expiry dateThe last day the service reads photos.
Request limitThe number of reading requests that may be processed. Every processed request of the four reading endpoints counts, including those that find nothing. Rejected photos (HTTP 400) do not count.
Machine codeThe license works only on the machine it was issued for. The code is derived from the TPM, mainboard, BIOS, system disk and operating system installation; a TPM 2.0 (physical or virtual) is required. Virtual machines are supported.

When the license ends

After the expiry date, or once the request limit is reached, the service keeps running but refuses reading requests with HTTP 403; /api/health reports unhealthy. The Test page shows the state of the license and warns during the last 30 days and the last 10% of the request limit.

GET /api/license/status

{
  "required": true,
  "valid": true,
  "reason": "",
  "machine_code": "V2-405E0C59-07062B76-6375DF01-A1864C24-402EAAF4-0FA699E8-603956FE-C215997A-F03B0DAB",
  "environment": {"virtual": false, "platform": "physical", "tpm_present": true, "...": "..."},
  "customer": "ACME Port",
  "expires": "2027-12-31",
  "days_left": 413,
  "machine_bound": true,
  "max_requests": 1000000,
  "used_requests": 15234,
  "updates_until": null
}

Getting or renewing a license

  1. Run makine_kodu.bat (Windows) or sudo ./makine_kodu.sh (Linux) in the installation folder and send the makine_kodu.txt it writes to Inoventa.
  2. Windows: copy the license.lic you receive to C:\ProgramData\I90GOST and run restart.bat as administrator, or use Lisans yükle in the management window.
    Linux: sudo ./yonetim.sh lisans /path/license.lic (copies the file to /var/lib/i90gost and restarts the service).

A machine code is specific to the operating system: a license bound to a machine under Windows does not work on the same machine under Linux, and the other way round. On Linux the machine code must be taken with sudo, and the TPM must be visible as /dev/tpmrm0.

A license bound to a machine stops working when the mainboard is replaced, the TPM is cleared, or a virtual machine is copied and started with a new identity; send the new machine code to Inoventa. Replacing the system disk or updating the BIOS alone does not affect the license.

Code examples

cURL

curl -X POST "http://SERVER:8000/api/get_Container_Info/?imgout=false" -F "file=@door.jpg"

C# (.NET)

using var client = new HttpClient { BaseAddress = new Uri("http://SERVER:8000") };
using var form = new MultipartFormDataContent();
var bytes = new ByteArrayContent(File.ReadAllBytes(@"C:\photos\truck.jpg"));
bytes.Headers.ContentType = new MediaTypeHeaderValue("image/jpeg");
form.Add(bytes, "file", "truck.jpg");

var response = await client.PostAsync("/api/get_Plate/?imgout=false", form);
var json = JObject.Parse(await response.Content.ReadAsStringAsync());

var first = json["detections"]?.FirstOrDefault();
if (first != null && (string)first["plate"] != "")
{
    string plate = (string)first["plate"];
    double? ocrConfidence = (double?)first["ocr_confidence"];
}

Python

import requests

with open("door.jpg", "rb") as photo:
    response = requests.post(
        "http://SERVER:8000/api/get_Container_Info/",
        params={"imgout": "false"},
        files={"file": ("door.jpg", photo, "image/jpeg")},
        timeout=60,
    )
data = response.json()
for detection in data["detections"]:
    info = detection["containerinfo"]
    confirmed = len(info["id"]) == 11 and info["confidence"] == 1.0
    print(info["id"], "confirmed" if confirmed else "unconfirmed", info["maxgross"], info["tare"])

Running the service

I90 GOST runs as a service that starts with the operating system and needs no internet connection. The same recognition code and the same API are delivered for Windows and for Linux; results are identical.

Windows

Installed as a Windows service named I90GOST (process I90GOST.exe). The installation folder contains I90GOST_Yonetim.exe, a small management window (in Turkish) that shows the state of the service and the license and offers buttons to install, remove, start, stop and restart the service, load a license, save the machine code and update the installation. The table below lists the equivalent manual steps.

TaskHow
Start / stop / restartWindows Services, or sc start I90GOST and sc stop I90GOST.
UpdateUnpack the new package to a temporary folder and run its update.bat as administrator. Settings, license and logs are kept.
Logslogs\YY\MM\i90gost_YYYY-MM-DD.log in the installation folder: one folder per month, one file per day (for example logs \i90gost_2026-11-13.log). Old months are not deleted automatically.

Linux (Ubuntu 24.04 or later)

Installed as a systemd service named i90gost (process i90gost, runs as root because the hardware identifiers and the TPM used by the license are readable by root only). The installation folder contains yonetim.sh: run sudo ./yonetim.sh for a menu (in Turkish), or use the commands below.

TaskHow
State of service and licensesudo ./yonetim.sh durum
Start / stop / restartsudo systemctl start i90gost, stop, restart (or sudo ./yonetim.sh baslat | durdur | yeniden).
UpdateUnpack the new archive to a temporary folder and run sudo ./update.sh there. Settings, license and logs are kept.
Logslogs/YY/MM/i90gost_YYYY-MM-DD.log in the installation folder (same layout as on Windows), and journalctl -u i90gost.

Both systems

TaskHow
Check that it is runningOpen http://localhost:8000/api/health.
SettingsThe .env file in the installation folder. Restart the service after a change.
Change the portSet PORT in .env and open that port in the firewall.

After a start the service loads its models for a few seconds; requests are answered once /api/health reports healthy.

The API Reference page (Swagger) loads its interface from the internet and does not open on a server without internet access. This guide and the Test page work offline.

Troubleshooting

SymptomWhat to check
Requests answer with HTTP 403 The license is missing, expired, used up or issued for another machine. Open the Test page or /api/license/status to see the reason.
No answer from the service Is the service running (Windows: I90GOST, Linux: i90gost)? Is the port open in the firewall? Look at the end of the log file of the day under logs.
detections is empty The number or plate was not found. It should be fully inside the photo, sharp and reasonably large. Very dark or strongly angled photos fail more often.
Plate returned as candidate The text is not a valid Turkish civil plate (foreign, military, temporary, or partly read).
Container number is unconfirmed The boxed check digit at the end of the number was not readable. Make sure the photo includes it and is not cut off at the right edge.
Weights are empty The weight table must be visible below the number on the same door, and you must call get_Container_Info.
Requests take long Requests are processed one by one. Hard photos need extra reading attempts with a larger model.

What changed in 1.7 and 1.8

  • New OCR models (PP-OCRv6). Container check digits are read far more often, so more numbers come back confirmed.
  • Container numbers: the rules that assemble the number were rewritten. Numbers are no longer shifted when stray marks are read next to the check digit.
  • Weights: read by position in the table and cross-checked with the LBS rows and with max gross − tare = payload.
  • Plates: new field ocr_confidence; new method suffixes +spacing, +verified, +partial, +noskew; cropped plates up to 450 pixels high are read directly; a wrongly estimated skew no longer causes an error.
  • 1.7.1 – tilted photos: get_Container_Info now reads the number from the same tight region as get_Container_ID and reads the weight table from a second region that follows the tilt of the photo. Numbers are confirmed far more often on photos taken at an angle.
  • 1.7.2 – service speed: the Windows service now opts out of the power throttling that Windows applies to background processes. On some machines requests through the service were several times slower than expected.
  • Installation: runs as a Windows service; Docker is no longer used.
  • 1.8.0 – license: a signed license file with expiry date, request limit and optional machine binding; state at /api/license/status. The earlier licence endpoints and the X-Usage-* response headers are gone.
  • 1.8.0 – Linux: the same version is also delivered for Ubuntu 24.04 and later as a systemd service. Requests, responses and results are the same as on Windows.

The paths, parameters and existing response fields are unchanged.