{"id":23706857,"url":"https://github.com/gkamboj/image-features-extractor","last_synced_at":"2026-04-16T19:03:35.934Z","repository":{"id":270147780,"uuid":"909470948","full_name":"gkamboj/image-features-extractor","owner":"gkamboj","description":"Detect object in any image along with its features like color, etc.","archived":false,"fork":false,"pushed_at":"2024-12-29T08:23:04.000Z","size":6900,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-30T02:45:06.801Z","etag":null,"topics":["color-classification","connexion","feature-extraction","flask","image-classification","image-recognition","machine-learning","numpy","opencv","python","resnet"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gkamboj.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,"zenodo":null}},"created_at":"2024-12-28T19:57:38.000Z","updated_at":"2024-12-29T08:23:06.000Z","dependencies_parsed_at":"2025-05-23T02:37:19.930Z","dependency_job_id":"b929b021-5226-4808-9bea-da5b5f257f7a","html_url":"https://github.com/gkamboj/image-features-extractor","commit_stats":null,"previous_names":["gkamboj/image-features-extractor","gkamboj/image-features-extractor-2"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gkamboj/image-features-extractor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gkamboj%2Fimage-features-extractor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gkamboj%2Fimage-features-extractor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gkamboj%2Fimage-features-extractor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gkamboj%2Fimage-features-extractor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gkamboj","download_url":"https://codeload.github.com/gkamboj/image-features-extractor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gkamboj%2Fimage-features-extractor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31899986,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"ssl_error","status_checked_at":"2026-04-16T18:21:47.142Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["color-classification","connexion","feature-extraction","flask","image-classification","image-recognition","machine-learning","numpy","opencv","python","resnet"],"created_at":"2024-12-30T16:00:46.294Z","updated_at":"2026-04-16T19:03:35.874Z","avatar_url":"https://github.com/gkamboj.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# image-features-extractor\n\nThis is my first attempt on creating a basic Flask application. This application allows to detect object in any image along with its features like color, etc. Inspirarion behind it was a POC to enable the image based search in the e-commerce website project I worked earlier.\n\n\n## Table of Contents\n- [Setup Instructions](#setup-instructions)\n- [Usage](#usage)\n- [Demo and Screenshots](#demo-and-screenshots)\n- [Future Improvements](#future-improvements)\n- [License](#license)\n\n\n## Setup Instructions\n\nAfter cloning the repository, follow these steps to set up the project:\n\n1. **Set Up your development environment**:\n   - Download and install JetBrains PyCharm IDE or your preferred IDE.\n   - The following instructions will focus on PyCharm, but most IDEs provide similar features.\n\n2. **Open the project**:\n   - In PyCharm, navigate to `File -\u003e Open` and select the cloned repository folder.\n\n3. **Set Up a local virtual environment**:\n   - Go to `Settings` \u003e `Project: finance-gpt` \u003e `Python Interpreter` \u003e `Add Interpreter`.\n   - Choose `Add Local Interpreter` \u003e `Virtualenv Environment`.\n     1. Select `Environment` -\u003e `New`.\n     2. Set `Base Interpreter` to your installed Python version (e.g., Python 3.x).\n     3. Click `OK`.\n\n4. **Install dependencies**:\n   Install required dependencies by running the following command in terminal through IDE:\n     ```bash\n     pip install -r requirements.txt\n     ```\n\n5. **Run the application**:\n   Application can be started by running the following command from the root folder:\n   ```bash\n   python -m cx_img.app\n   ```\n\n\n## Usage\n\nThe application does not include a user interface (UI) but provides two APIs that can be accessed using Postman or any other API client. These APIs are:\n\n1. **Training API**  \n   - This API generates a training data file based on [data source color images](https://github.com/gkamboj/image-features-extractor/tree/main/cx_img/resources/color_detection/training_dataset/training_dataset).  \n   - It uses color classification to extract and store RGB values for each image in the data source.  \n   - Special thanks to [color_recognition by ahmetozlu](https://github.com/ahmetozlu/color_recognition) for inspiring this approach.\n\n2. **Image Classification API**  \n   - This API processes input images and returns data about the detected objects, including their confidence scores and features such as color.  \n   - The object detection model is based on ResNet40.\n   - For color detection, area of main object in the image is identified first through **GrabCut algorithm**. [KNN algorithm](https://en.wikipedia.org/wiki/K-nearest_neighbors_algorithm) is then applied on this object by referencing the training data to determine the color corresponding to the object's RGB values.\n\n### Notes:\n- The **Training API** must be executed once during setup to generate the necessary training data for accurate image classification results.  \n- To access the Swagger UI for API documentation, navigate to [http://localhost:5001/ui](http://localhost:5001/ui) (or the appropriate port if different).\n\n## Demo and Screenshots\nHere are some screenshots showcasing working deployments of the application.\n- _Image Classification_ API and sample response:\n   - Postman:\n     \u003cimg width=\"1037\" alt=\"image\" src=\"https://github.com/user-attachments/assets/e020b0dd-ce9e-4bd7-aa6c-a912339676e9\" /\u003e\n   - Sample input image:\n     ![AirMax270](https://github.com/user-attachments/assets/9a9d70c2-e333-4dc9-b806-f5c15497845e)\n   - Response corresponding to the sample input image:\n     ```\n     {\n       \"result\": {\n           \"attributes\": {\n               \"color\": {\n                   \"name\": [\n                       \"black\"\n                   ],\n                   \"rgb\": \"46,46,46\"\n               }\n           },\n           \"detection\": [\n               {\n                   \"confidence\": \"0.96429\",\n                   \"model\": \"resnet50\",\n                   \"name\": \"running_shoe\"\n               }\n           ]\n       },\n       \"success\": true\n     }\n     ```\n\n- Swagger UI:\n  \u003cimg width=\"1625\" alt=\"image\" src=\"https://github.com/user-attachments/assets/7dcc1daa-9070-40bd-9183-f03c617b82ee\" /\u003e\n\n\n## Future Improvements\nPotential enhancements for future development include:\n- Improving color detection accuracy by expanding the dataset with more diverse training images.  \n- Adding additional features such as:\n  - Object type detection.  \n  - Features specific to object types (e.g., collar type, pattern, and color for shirts; brand and color for mobile phones).\n- The current use of **ResNet40**, a pretrained model, may limit accuracy for object detection. To achieve higher accuracy, a custom model can be created and trained with a dataset relevant to your usecase.  \n- The current approach of using **KNN for color detection** does not perform well for images with multiple colors. A more advanced method is required to handle such scenarios effectively.  \n\n## License\nThis project is licensed under the MIT License. See the LICENSE file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgkamboj%2Fimage-features-extractor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgkamboj%2Fimage-features-extractor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgkamboj%2Fimage-features-extractor/lists"}