{"id":13599745,"url":"https://github.com/cyrildiagne/u2net-http","last_synced_at":"2025-10-13T00:03:32.869Z","repository":{"id":43237965,"uuid":"262683892","full_name":"cyrildiagne/u2net-http","owner":"cyrildiagne","description":"HTTP Wrapper for U^2-Net (Qin et al, Pattern Recognition 2020)","archived":false,"fork":false,"pushed_at":"2022-11-22T05:08:32.000Z","size":9,"stargazers_count":87,"open_issues_count":4,"forks_count":22,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-20T19:16:40.065Z","etag":null,"topics":[],"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/cyrildiagne.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}},"created_at":"2020-05-10T00:28:20.000Z","updated_at":"2024-11-15T18:38:38.000Z","dependencies_parsed_at":"2023-01-21T17:02:53.060Z","dependency_job_id":null,"html_url":"https://github.com/cyrildiagne/u2net-http","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrildiagne%2Fu2net-http","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrildiagne%2Fu2net-http/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrildiagne%2Fu2net-http/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrildiagne%2Fu2net-http/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cyrildiagne","download_url":"https://codeload.github.com/cyrildiagne/u2net-http/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247251992,"owners_count":20908605,"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":[],"created_at":"2024-08-01T17:01:10.527Z","updated_at":"2025-10-13T00:03:32.801Z","avatar_url":"https://github.com/cyrildiagne.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# U^2-Net HTTP\n\nThis is an HTTP service wrapper of the model: [U^2-Net: Going Deeper with Nested U-Structure for Salient Object Detection](https://github.com/NathanUA/U-2-Net) (Qin et al, Pattern Recognition 2020)\n\nThe deploy folder contains configuration files for deployment as serverless container with Knative.\n\n# Usage:\n\n```bash\ndocker run --rm -p 8080:80 docker.io/cyrildiagne/u2net-http\n```\n\n# Test:\n\n```bash\ncurl -F \"data=@test.jpg\" http://localhost:8080 -o result.png\n```\n\n# Development\n\n- Clone this repository: `git clone https://github.com/cyrildiagne/u2net-http.git`\n- Go into the cloned directory: `cd u2net-http`\n- Clone the official [U^2-Net repository](https://github.com/NathanUA/U-2-Net)\n- Download the pretrained model [u2net.pth](https://drive.google.com/file/d/1ao1ovG1Qtx4b7EoskHXmi2E9rp5CHLcZ/view)\n- Put the file inside the `U-2-Net/saved_models/u2net/` folder.\n\n# Build from source:\n\n### Option 1 - Locally with virtualenv\n\n```bash\nvirtualenv venv\nvenv/bin/activate\n```\n\n```bash\npip install torch==0.4.1\npip install -r requirements.txt\n```\n\n```\npython main.py\n```\n\n### Option 2 - Using Docker\n\nAfter you've retrieved the U^2-Net model.\n\nDownload Resnet checkpoint\n```\ncurl https://download.pytorch.org/models/resnet34-333f7ec4.pth -o resnet34-333f7ec4.pth\n```\n\n```\ndocker build -t u2net .\ndocker run --rm -p 8080:80 u2net\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyrildiagne%2Fu2net-http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyrildiagne%2Fu2net-http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyrildiagne%2Fu2net-http/lists"}