{"id":23864489,"url":"https://github.com/ibebbs/u2net-cpu-http","last_synced_at":"2025-07-02T14:37:11.003Z","repository":{"id":148899840,"uuid":"288192597","full_name":"ibebbs/U2Net-cpu-HTTP","owner":"ibebbs","description":null,"archived":false,"fork":false,"pushed_at":"2020-08-21T16:16:53.000Z","size":6,"stargazers_count":4,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-25T08:41:38.355Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/ibebbs.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":"2020-08-17T13:49:43.000Z","updated_at":"2022-02-24T07:28:25.000Z","dependencies_parsed_at":"2023-07-17T00:15:24.658Z","dependency_job_id":null,"html_url":"https://github.com/ibebbs/U2Net-cpu-HTTP","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ibebbs/U2Net-cpu-HTTP","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibebbs%2FU2Net-cpu-HTTP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibebbs%2FU2Net-cpu-HTTP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibebbs%2FU2Net-cpu-HTTP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibebbs%2FU2Net-cpu-HTTP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ibebbs","download_url":"https://codeload.github.com/ibebbs/U2Net-cpu-HTTP/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibebbs%2FU2Net-cpu-HTTP/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263157557,"owners_count":23422654,"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":"2025-01-03T08:26:28.942Z","updated_at":"2025-07-02T14:37:10.993Z","avatar_url":"https://github.com/ibebbs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"**Forked from [ideo](https://github.com/ideo/bg-removal-with-u2net) and changed to perform inference on CPU only**\n\n# 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 ibebbs/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:8080 u2net\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibebbs%2Fu2net-cpu-http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fibebbs%2Fu2net-cpu-http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibebbs%2Fu2net-cpu-http/lists"}