Closed kartikbhtt7 closed 3 months ago
The recent changes introduce a blur detection feature for images of documents. This includes a new Docker environment setup, an API for blur classification using Hypercorn, image processing utilities, and enhanced functionality for handling requests and models. The feature leverages an SVM model for classification and provides comprehensive documentation and error-handling within the system.
Files | Summary |
---|---|
blur_detection/Dockerfile |
Sets up a Python 3.9-slim Docker environment, installs dependencies, copies code, exposes port 8000, and runs the server using Hypercorn. |
blur_detection/README.md |
Details instructions for building and running the blur detection model using Docker, with example API calls and JSON response formats. |
blur_detection/__init__.py |
Imports entities from request.py and model.py . |
blur_detection/api.py |
Defines a web service to classify images as blurry or not using a machine learning model; includes routes and initialization routines. |
blur_detection/model.py |
Implements the Model class that loads an SVM model from Hugging Face and classifies images based on edge features. Adds create and classify_image methods. |
blur_detection/request.py |
Introduces ModelRequest to handle model requests with a method to convert objects to JSON. Adds to_json method. |
blur_detection/requirements.txt |
Specifies updated project dependencies for various Python packages needed. |
blur_detection/utilities.py |
Adds functions for image normalization, edge feature computation, and statistical feature calculation. |
run/blur_script.py |
Introduces functionality to classify images using a local server, save results as JSON files, and handle errors asynchronously. Adds multiple utility functions and a main execution block. |
sequenceDiagram
participant Client
participant API
participant Model
participant Utilities
Client->>+API: POST /classify-image (Image File)
API->>+Model: Initialize Model
Model->>Utilities: Process Image
Utilities->>Model: Return Features
Model->>API: Classification Result
API->>-Client: JSON Response
Here comes a rabbit, coding with delight,
Enhancing blur detection, day and night.
With Docker's might and Hypercorn's speed,
This model caters to every need.
JSON responses, clear and bright,
Classify those images, wrong or right! 🚀
[!TIP]
AI model upgrade
## `gpt-4o` model for reviews and chat is now live OpenAI claims that this model is better at understanding and generating code than the previous models. Please join our [Discord Community](https://discord.com/invite/GsXnASn26c) to provide any feedback or to report any issues.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
New Features
Documentation
Chores