{"id":24396848,"url":"https://github.com/fahimfba/safelicensing","last_synced_at":"2025-06-25T02:35:41.380Z","repository":{"id":271775931,"uuid":"914515860","full_name":"FahimFBA/SafeLicensing","owner":"FahimFBA","description":"Safeguard vehicles' licenseplates from unauthorized access (Image and Video both)","archived":false,"fork":false,"pushed_at":"2025-03-06T14:02:02.000Z","size":7922,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-06T14:24:51.887Z","etag":null,"topics":["digital-image-analysis","digital-image-processing","license-plate-recognition","machine-learning","machinelearning"],"latest_commit_sha":null,"homepage":"https://safelicensing.streamlit.app/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FahimFBA.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2025-01-09T18:45:08.000Z","updated_at":"2025-03-06T14:02:06.000Z","dependencies_parsed_at":"2025-03-06T14:35:00.132Z","dependency_job_id":null,"html_url":"https://github.com/FahimFBA/SafeLicensing","commit_stats":null,"previous_names":["fahimfba/safelicensing"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FahimFBA/SafeLicensing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FahimFBA%2FSafeLicensing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FahimFBA%2FSafeLicensing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FahimFBA%2FSafeLicensing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FahimFBA%2FSafeLicensing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FahimFBA","download_url":"https://codeload.github.com/FahimFBA/SafeLicensing/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FahimFBA%2FSafeLicensing/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261791758,"owners_count":23210192,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["digital-image-analysis","digital-image-processing","license-plate-recognition","machine-learning","machinelearning"],"created_at":"2025-01-19T21:58:43.696Z","updated_at":"2025-06-25T02:35:41.350Z","avatar_url":"https://github.com/FahimFBA.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SafeLicensing\n\nThis project demonstrates a pipeline for detecting license plates in images using YOLOv8 and encrypting the detected regions with a Chaotic Logistic Map encryption algorithm. It provides a user-friendly interface built with Streamlit.\n\n\u003e[!TIP]\n\u003e You can directly test the application on the web using the following link: [![Open in Streamlit](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://share.streamlit.io/fahimfba/safelicensing/main/app.py)\n\n## Features\n\n- **License Plate Detection**: Uses the YOLOv8 model to detect license plates in uploaded images.\n- **Chaotic Encryption**: Encrypts the detected license plate regions using a two-layer XOR-based chaotic logistic map algorithm.\n- **Streamlit Web App**: A simple interface to upload images, detect license plates, encrypt them, and download the results.\n\n## Installation\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/FahimFBA/SafeLicensing.git\n   cd SafeLicensing\n   ```\n\n2. Install `ffmpeg` for video processing (Linux):\n   ```bash\n   sudo apt-get install ffmpeg\n   ```\n\n   or, for macOS:\n   ```bash\n   brew install ffmpeg\n   ```\n\n3. Install the required dependencies:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n4. Download the YOLOv8 weights file (`best.pt`) and place it in the root directory of the project. You can train your own model or use a pre-trained one. This repository already have our model from [SEncrypt](https://github.com/IsratIJK/SEncrypt) located in [best.pt](./best.pt) file.\n\n## Usage\n\n1. Run the Streamlit app:\n   ```bash\n   streamlit run app.py\n   ```\n\n2. Open the app in your browser (typically at `http://localhost:8501`).\n\n3. Follow the steps:\n   - Upload an image or provide a URL.\n   - Adjust the encryption key seed using the slider.\n   - Click the \"Detect \u0026 Encrypt\" button to process the image.\n\n4. Download the encrypted image directly from the app.\n\n## Docker Usage\n\nYou can run this application using Docker. There are two options: CPU-only and GPU-enabled.\n\n### CPU Version\n\n1. Build the Docker image:\n   ```bash\n   docker build -t safelicensing .\n   ```\n\n2. Run the Docker container:\n   ```bash\n   docker run -d -p 8501:8501 --name safelicensing_container safelicensing\n   ```\n\n### GPU Version (for NVIDIA GPU users)\n\n1. Ensure you have the NVIDIA Container Toolkit installed. If not, follow the [official installation guide](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html).\n\n2. Build the GPU-enabled Docker image:\n   ```bash\n   docker build -f Dockerfile.gpu -t safelicensing-gpu .\n   ```\n\n3. Run the GPU-enabled Docker container:\n   ```bash\n   docker run -d -p 8501:8501 --gpus all --name safelicensing_gpu_container safelicensing-gpu\n   ```\n\n### Common Steps\n\n4. Check if the container is running:\n   ```bash\n   docker ps\n   ```\n   You should see a container named `safelicensing_container` or `safelicensing_gpu_container` in the list.\n\n5. View the container logs:\n   ```bash\n   docker logs safelicensing_container  # or safelicensing_gpu_container for GPU version\n   ```\n   This will show you the Streamlit startup logs and any errors if they occur.\n\n6. Open the app in your browser by navigating to `http://localhost:8501`.\n\nIf you encounter any issues:\n- Ensure that port 8501 is not being used by another application.\n- Check the container logs for any error messages.\n- If needed, you can stop and remove the container using:\n  ```bash\n  docker stop safelicensing_container  # or safelicensing_gpu_container\n  docker rm safelicensing_container  # or safelicensing_gpu_container\n  ```\n  Then, try running the container again.\n\nNote: The GPU version requires an NVIDIA GPU and proper drivers. If you don't have a compatible GPU, use the CPU version instead.\n\n## Workflow\n\n1. **License Plate Detection**:\n   - The YOLOv8 model is used to detect license plates in the input image. The model has been taken from [SEncrypt](https://github.com/IsratIJK/SEncrypt).\n   - Detected regions are highlighted with bounding boxes.\n\n2. **Chaotic Logistic Map Encryption**:\n   - A chaotic logistic map generates two XOR-based encryption keys.\n   - Pixels in the license plate regions are shuffled and encrypted in two stages.\n   - The encrypted region replaces the original plate in the image.\n\n3. **Visualization and Download**:\n   - The original, detected, and encrypted images are displayed in the app.\n   - Encrypted images can be downloaded as PNG files.\n\n## Files\n\n- `app.py`: The main Streamlit app file.\n- `requirements.txt`: Python dependencies for the project.\n- `best.pt`: YOLOv8 weights file (not included, add your own).\n\n## Key Parameters\n\n- **Encryption Key Seed**: A slider in the app adjusts the seed value for the chaotic logistic map, affecting the encryption's randomness.\n\n## Example Screenshots\n\n### Original Image\n\n![Original Image](./img/lpr-tesla-license-plate-recognition-1910x1000.jpg)\n\n### Encrypted Image\n\n![Encrypted Image](./img/encrypted_plate.png)\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.\n\n## Contact\n\nFor any queries, feel free to reach out:\n\n- **Author**: Md. Fahim Bin Amin\n- **GitHub**: [FahimFBA](https://github.com/FahimFBA)\n\n- **Other Authors**: [Rafid Mehda](https://github.com/rafid29mehda), [Israt Jahan Khan](https://github.com/IsratIJK)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffahimfba%2Fsafelicensing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffahimfba%2Fsafelicensing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffahimfba%2Fsafelicensing/lists"}