{"id":22160626,"url":"https://github.com/mandarwagh9/image-segmenting-using-sam2","last_synced_at":"2025-07-26T09:31:44.255Z","repository":{"id":251374372,"uuid":"837228972","full_name":"mandarwagh9/Image-segmenting-using-SAM2","owner":"mandarwagh9","description":"Image segmentation application that utilizes the SAM2 (Segment Anything Model) via API to perform object detection and segmentation on uploaded images.","archived":false,"fork":false,"pushed_at":"2024-08-08T07:16:25.000Z","size":5833,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T02:05:33.412Z","etag":null,"topics":["ai","artificial-intelligence","meta-sam2","python","sam2"],"latest_commit_sha":null,"homepage":"https://image-segmenting-using-sam-2.vercel.app","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/mandarwagh9.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-08-02T13:40:23.000Z","updated_at":"2025-03-02T17:49:26.000Z","dependencies_parsed_at":"2024-08-02T15:39:28.468Z","dependency_job_id":null,"html_url":"https://github.com/mandarwagh9/Image-segmenting-using-SAM2","commit_stats":null,"previous_names":["mandarwagh9/image-segmenting-using-sam2"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mandarwagh9/Image-segmenting-using-SAM2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mandarwagh9%2FImage-segmenting-using-SAM2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mandarwagh9%2FImage-segmenting-using-SAM2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mandarwagh9%2FImage-segmenting-using-SAM2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mandarwagh9%2FImage-segmenting-using-SAM2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mandarwagh9","download_url":"https://codeload.github.com/mandarwagh9/Image-segmenting-using-SAM2/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mandarwagh9%2FImage-segmenting-using-SAM2/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267145524,"owners_count":24042650,"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","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["ai","artificial-intelligence","meta-sam2","python","sam2"],"created_at":"2024-12-02T04:09:05.043Z","updated_at":"2025-07-26T09:31:43.010Z","avatar_url":"https://github.com/mandarwagh9.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Image Segmenting using SAM2\r\n\r\nThis project is an image segmentation application that utilizes the SAM2 (Segment Anything Model) to perform object detection and segmentation on uploaded images.\r\n\r\n## Features\r\n\r\n- **Image Upload**: Allows users to upload images.\r\n- **Segmentation**: Uses SAM2 model to segment objects within the image.\r\n- **Results**: Displays segmented masks and combined mask of the image.\r\n\r\n## Getting Started\r\n\r\n### Prerequisites\r\n\r\n- Python 3.6 or later\r\n- Flask\r\n- Replicate Python Client\r\n\r\n### Installation\r\n\r\n1. **Clone the Repository**\r\n\r\n   ```bash\r\n   git clone https://github.com/mandarwagh9/Image-segmenting-using-SAM2.git\r\n   cd Image-segmenting-using-SAM2\r\n   ```\r\n\r\n2. **Install Dependencies**\r\n\r\n   Create a virtual environment and install the required packages:\r\n\r\n   ```bash\r\n   python -m venv venv\r\n   source venv/bin/activate  # On Windows use `venv\\Scripts\\activate`\r\n   pip install -r requirements.txt\r\n   ```\r\n\r\n3. **Set Up Environment Variables**\r\n\r\n   Create a `.env` file in the project root and add your Replicate API token:\r\n\r\n   ```bash\r\n   REPLICATE_API_TOKEN=your_replicate_api_token_here\r\n   ```\r\n\r\n### Running the Application\r\n\r\n1. **Start the Flask Server**\r\n\r\n   ```bash\r\n   python app.py\r\n   ```\r\n\r\n2. **Access the Application**\r\n\r\n   Open a web browser and navigate to `http://127.0.0.1:5000/` to access the application.\r\n\r\n## Usage\r\n\r\n1. **Navigate to the Application**\r\n\r\n   Open your web browser and go to `http://127.0.0.1:5000/`.\r\n\r\n2. **Upload an Image**\r\n\r\n   Use the upload form to select and upload an image. Ensure the image is in one of the allowed formats: PNG, JPG, JPEG, or GIF and its uploaded to a image hosting site, and you are able to provide a link in the `app.py` for further processing.\r\n\r\n3. **View Results**\r\n\r\n   After uploading, the application will process the image using the SAM2 model and display the segmentation results, including combined and individual masks in your terminal to be specific.\r\n\r\n### File Structure\r\n\r\n- `app.py`: Main Flask application file.\r\n- `templates/`: Directory containing HTML templates for the web pages.\r\n- `uploads/`: Directory for storing uploaded images.\r\n- `requirements.txt`: File listing the Python dependencies.\r\n\r\n### Contributing\r\n\r\nFeel free to fork the repository and submit pull requests. For any issues or feature requests, please open an issue on GitHub.\r\n\r\n### License\r\n\r\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\r\n\r\n### Acknowledgements\r\n\r\n- [Replicate](https://replicate.com) for providing the SAM2 model.\r\n- [Flask](https://flask.palletsprojects.com/en/2.0.x/) for the web framework.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmandarwagh9%2Fimage-segmenting-using-sam2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmandarwagh9%2Fimage-segmenting-using-sam2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmandarwagh9%2Fimage-segmenting-using-sam2/lists"}