{"id":34649700,"url":"https://github.com/pstwh/platerec-model","last_synced_at":"2026-05-25T08:34:38.597Z","repository":{"id":250378750,"uuid":"833649945","full_name":"pstwh/platerec-model","owner":"pstwh","description":"platerec-model is a model for recognizing text from images, specifically designed for license plate recognition","archived":false,"fork":false,"pushed_at":"2025-02-08T05:32:25.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-08T06:25:05.945Z","etag":null,"topics":["deep-learning","license","model","plate","plate-recognition","torch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pstwh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-25T13:24:54.000Z","updated_at":"2024-07-27T20:23:40.000Z","dependencies_parsed_at":"2024-07-26T23:29:38.987Z","dependency_job_id":null,"html_url":"https://github.com/pstwh/platerec-model","commit_stats":null,"previous_names":["pstwh/platerec-model"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pstwh/platerec-model","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pstwh%2Fplaterec-model","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pstwh%2Fplaterec-model/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pstwh%2Fplaterec-model/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pstwh%2Fplaterec-model/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pstwh","download_url":"https://codeload.github.com/pstwh/platerec-model/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pstwh%2Fplaterec-model/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33467428,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-25T06:32:55.349Z","status":"ssl_error","status_checked_at":"2026-05-25T06:32:35.322Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","license","model","plate","plate-recognition","torch"],"created_at":"2025-12-24T17:54:23.113Z","updated_at":"2026-05-25T08:34:38.592Z","avatar_url":"https://github.com/pstwh.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n## platerec-model\nplaterec-model is a model for recognizing text from images, specifically designed for license plate recognition. The project utilizes a neural network architecture with an encoder-decoder setup and uses SAM (Sharpness-Aware Minimization) for optimizing the model training process. It's really lightweight using only a mobilenet v2 for encoder and a decoder transformer (gpt) for decoder. It is used in the platerec project.\n\nThe idea is to transform this training repository into a library that can be used easily.\n\n### Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [Training](#training)\n- [Inference](#inference)\n- [Model Architecture](#model-architecture)\n\n### Installation\n\n1. **Clone the Repository:**\n   ```bash\n   git clone https://github.com/your-username/platerec-model.git\n   cd platerec-model   \n   ```\n\n2. **Install Dependencies:**\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n### Usage\n\n#### Training\n\nTo train the model, use the following command:\n\n```bash\npython train.py --config_path config.yaml --model_checkpoint artifacts/trained_model.pth --device cuda --num_epochs 10\n```\n\nDataset is expected to be in the following format:\n```\n├── 1.jpg\n├── 1.txt\n├── 2.jpg\n├── 2.txt\n├── 3.jpg\n├── 3.txt\n├── 4.jpg\n└── 4.txt\n```\n\n- `--model_checkpoint`: Path to a pretrained model (.pth file) if you have.\n- `--device`: The device to use for training (`cuda` or `cpu`). Defaults to `cuda` if available.\n- `--num_epochs`: Number of epochs for training. Default is 10.\n\n#### Inference\n\nTo perform inference with the trained model, use the following command:\n\n```bash\npython inference.py --model_path artifacts/trained_model.pth --tokenizer_path artifacts/tokenizer.json --image_path test_image.jpg\n```\n\n**Parameters:**\n- `--model_path`: Path to the trained model checkpoint (.pth file).\n- `--tokenizer_path`: Path to the tokenizer file (.json file).\n- `--image_path`: Path to the image file for which text recognition is to be performed.\n\n### Model Architecture\n\nThe platerec-model employs an encoder-decoder architecture with cross-attention mechanisms. The key components are:\n\n- **Encoder:** Based on `mobilenet_v2` for feature extraction from images.\n- **Decoder:** Utilizes an embedding layer, position encoding, and multiple decoder blocks with self-attention and cross-attention layers.\n- **Loss Function:** Uses `cross_entropy` loss, with special handling for a specific index (`ignore_index of ~ token`).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpstwh%2Fplaterec-model","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpstwh%2Fplaterec-model","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpstwh%2Fplaterec-model/lists"}