Skip to content

Locally trained OCR model for recognizing shipping container codes using Tesseract OCR. Backend Spring Boot. Frontend built with Vite.

License

Notifications You must be signed in to change notification settings

m-fol/SAFEContain

Repository files navigation

SAFEContain

Recognizing Container Codes with OCR

image

SafeContain is a computer vision project focused on recognizing container identification codes from images, following the ISO 6346 standard. It was developed as part of a broader effort to support more automated, accurate, and verifiable tracking of shipping containers in ports, warehouses, and logistics hubs.

The system is designed to work with real-world container images—whether from handheld devices, surveillance cameras, or aerial views—and extract the full code (e.g. MSCU1234567), breaking it into its component parts and validating it according to international standards.

What the Project Does

  • Takes in an image of a shipping container
  • Locates and reads the container code using OCR
  • Parses the code into segments (owner, serial number, check digit)
  • Validates the result using ISO 6346 rules
  • Returns a clean, structured output ready for further use

This can help reduce human error during manual checks and streamline digital record-keeping in supply chain operations.


How to Get Started

1. Clone the Repository

git clone https://github.com/m-fol/safecontain.git
cd safecontain

2. Install Dependencies

We recommend using a virtual environment.

pip install -r requirements.txt

3. Run Inference on a Sample Image

python infer.py --image_path examples/sample1.jpg

You’ll see output like:

Detected code: MSCU1234567
Owner: MSC
Serial Number: 123456
Check Digit: 7
Valid: True

About

Locally trained OCR model for recognizing shipping container codes using Tesseract OCR. Backend Spring Boot. Frontend built with Vite.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published