{"id":24543636,"url":"https://github.com/aditya-ranjan1234/imagecaption-api","last_synced_at":"2025-03-16T08:08:51.581Z","repository":{"id":263999990,"uuid":"892047983","full_name":"Aditya-Ranjan1234/ImageCaption-API","owner":"Aditya-Ranjan1234","description":"An API for generating captions, music genres, and privacy analysis based on images using FastAPI and LlamaIndex.","archived":false,"fork":false,"pushed_at":"2024-11-21T19:46:48.000Z","size":49,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-22T20:14:27.425Z","etag":null,"topics":["api","api-rest","generative-ai","llama-index"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Aditya-Ranjan1234.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":"2024-11-21T12:22:03.000Z","updated_at":"2024-12-22T05:21:19.000Z","dependencies_parsed_at":"2024-11-21T13:26:55.528Z","dependency_job_id":"efb16b39-d6c0-45b8-a8b4-c38a35c36169","html_url":"https://github.com/Aditya-Ranjan1234/ImageCaption-API","commit_stats":null,"previous_names":["aditya-ranjan1234/imagecaption-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aditya-Ranjan1234%2FImageCaption-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aditya-Ranjan1234%2FImageCaption-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aditya-Ranjan1234%2FImageCaption-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aditya-Ranjan1234%2FImageCaption-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aditya-Ranjan1234","download_url":"https://codeload.github.com/Aditya-Ranjan1234/ImageCaption-API/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243841230,"owners_count":20356446,"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":["api","api-rest","generative-ai","llama-index"],"created_at":"2025-01-22T20:14:35.895Z","updated_at":"2025-03-16T08:08:51.562Z","avatar_url":"https://github.com/Aditya-Ranjan1234.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ImageCaption-API\n\n## Image Caption and Music Genre Generation API\n\nThis API analyzes images to generate captions, identify potential privacy risks, and recommend music genres based on the visual content of the image. It leverages FastAPI, LlamaIndex, and multimodal AI models to perform these tasks.\n\n## Features:\n**Image Caption Generation**: Generates a high-level description of the image.    \n**Music Genre Recommendation**: Suggests a fitting music genre based on the image content.   \n**Privacy Analysis**: Identifies potential privacy or security risks in the image.  \n\n## Technologies:\n**FastAPI** for the API backend  \n**LlamaIndex** for multimodal AI image processing  \n**Ollama** models for privacy and music genre generation  \n\n## Steps to Run Locally\n\n### 1. Clone the Repository:\n```bash\ngit clone https://github.com/Aditya-Ranjan1234/ImageCaption-API.git\ncd image-caption-api\n```\n\n### 2. Install Dependencies:\nInstall the required dependencies using pip:\n```bash\npip install -r requirements.txt\n```\n\n### 3. Run the Ollama Server:\nTo use the `Ollama` model, start the Ollama server on port 11434 by running the following command:\n```bash\nollama run llava-llama3\nollama serve\n```\nThis will start the Ollama server with the `llava-llama3` model and make it available on port `11434`.\n\n### 4. Run the FastAPI Server:\nStart the FastAPI server with Uvicorn:\n```bash\nuvicorn app:app --host 0.0.0.0 --port 8000\nuvicorn app:app --host 0.0.0.0 --port 8000 --timeout-keep-alive 0  # in case CPU instead of GPU so long processing times\n```\nThis will start the API locally on `http://localhost:8000`.\n\n### 5. Expose the API Publicly Using ngrok:\nTo make the API accessible from the internet, use ngrok:\n```bash\nngrok http 8000\n```\nThis will generate a public URL that you can use to interact with the API, such as `https://\u003cngrok-subdomain\u003e.ngrok-free.app`.\n\n### 6. Test the API:\nYou can test the API using tools like **curl**, **Postman**, or any frontend by sending a POST request to the `/analyze-image` endpoint with an image.\n\n### Example curl Command:\n```bash\ncurl -X POST -F \"file=@path/to/images/test.jpg\" https://\u003cngrok-subdomain\u003e.ngrok-free.app/analyze-image\n```\n\n### 7. View the Output:\nThe response will include:\n**Image Description**: A high-level summary of the image.  \n**Music Genre**: The most fitting music genre based on the image.  \n**Privacy Information**: Any potential privacy risks or concerns detected in the image.  \n\n## Contributing:\nFeel free to fork the repo, make changes, and submit pull requests for improvements!\n\n## License:\nThis project is licensed under the GPL License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faditya-ranjan1234%2Fimagecaption-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faditya-ranjan1234%2Fimagecaption-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faditya-ranjan1234%2Fimagecaption-api/lists"}