Skip to content

Commit

Permalink
Merge branches 'main' and 'main' of ssh://github.com/xhiroga/til
Browse files Browse the repository at this point in the history
  • Loading branch information
xhiroga committed Aug 28, 2024
2 parents 229ef55 + b4df1df commit 7fa47d4
Show file tree
Hide file tree
Showing 11 changed files with 1,535 additions and 602 deletions.
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.mypy_cache

# General
.env
.local
Expand Down Expand Up @@ -88,7 +90,3 @@ _site/
# Ignore folders generated by Bundler
.bundle/
vendor/



/.luarc.json

This file was deleted.

This file was deleted.

2 changes: 2 additions & 0 deletions software-engineering/openpose/_src/demo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
input/
output/
14 changes: 14 additions & 0 deletions software-engineering/openpose/_src/demo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# OpenPose

```powershell
bin\OpenPoseDemo.exe --image_dir "C:\Users\hiroga\Documents\GitHub\til\software-engineering\openpose\_src\demo\input" -disable_blending --face --hand --write_json "C:\Users\hiroga\Documents\GitHub\til\software-engineering\openpose\_src\demo\output\image" --write_images "C:\Users\hiroga\Documents\GitHub\til\software-engineering\openpose\_src\demo\output\image"
```

```powershell
bin\OpenPoseDemo.exe --video "C:\Users\hiroga\Downloads\dance.mov" --face --hand --write_video "C:\Users\hiroga\Documents\GitHub\til\software-engineering\openpose\_src\demo\output\video\dance.mov"
```

## Note

- 日本語のファイル名を認識させるのに調整がいるかも
- フォルダを事前に作成する必要があるかも
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 背景透過ソフトウェアの比較
# briaai/RMBG

## Pre-requisites
## Prerequisites

```powershell
kaggle datasets download -d mikoajkolman/pokemon-images-first-generation17000-files -p "data/" -q
Expand All @@ -10,19 +10,14 @@ kaggle datasets download -d mikoajkolman/pokemon-images-first-generation17000-fi
## briaai/RMBG-1.4

```powershell
conda env create -f environment.yml
conda activate background-removal
git clone https://huggingface.co/briaai/RMBG-1.4
cd RMBG-1.4/
pip install -r requirements.txt
uv sync
```

### Multiprocessing

```powershell
conda activate background-removal
python remove_background_multiprocess.py
uv run src/rmbg/remove_background_multiprocess.py
# 途中で実行を止めたが、200件に対して1時間以上かかるようになってしまった。
# GPU利用率は0%と100%を往復しており、処理時間は徐々に長くなっていった。明らかにおかしい。
```
352 changes: 352 additions & 0 deletions software-engineering/python/RMBG/_src/RMBG/briarmbg.ipynb

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions software-engineering/python/RMBG/_src/RMBG/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[project]
name = "rmbg"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
"imageio>=2.35.1",
"matplotlib>=3.9.2",
"scikit-image>=0.24.0",
"torch==2.2.0+cu121",
"torchvision==0.17.0+cu121",
"pillow>=10.2.0",
"numpy>=1.26.3",
"typing>=3.10.0.0",
"huggingface-hub>=0.24.6",
"safetensors>=0.4.4",
]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel]
packages = ["src/rmbg"]

[tool.uv]
dev-dependencies = [
"ipykernel>=6.29.5",
"types-pillow>=10.2.0.20240822",
]
extra-index-url = ["https://download.pytorch.org/whl/cu121"]
Loading

0 comments on commit 7fa47d4

Please sign in to comment.