|
|
--- |
|
|
pretty_name: InkEraser |
|
|
license: apache-2.0 |
|
|
language: |
|
|
- zh |
|
|
- en |
|
|
task_categories: |
|
|
- image-to-image |
|
|
size_categories: |
|
|
- 1K<n<10K |
|
|
tags: |
|
|
- image-to-image |
|
|
- inpainting |
|
|
- handwriting |
|
|
- paired-images |
|
|
configs: |
|
|
- config_name: default |
|
|
drop_labels: true |
|
|
--- |
|
|
|
|
|
# ynyg/InkEraser |
|
|
|
|
|
筆跡擦除數據集,用於將含有筆跡的圖像(source)轉換為去除筆跡的目標圖像(target)。 |
|
|
|
|
|
## 文件結構 |
|
|
``` |
|
|
data/ |
|
|
train/ |
|
|
source/ # 原圖(含筆跡) |
|
|
target/ # 目標(去筆跡) |
|
|
val/ |
|
|
source/ |
|
|
target/ |
|
|
``` |
|
|
|
|
|
## 配對規則 |
|
|
- `source/` 與 `target/` 中使用**完全相同的文件名**進行一一對應。 |
|
|
- 圖像格式:`.jpg`。 |
|
|
|
|
|
## 數據量(當前倉庫) |
|
|
- train:1511 對 |
|
|
- val:115 對 |
|
|
- 合計:1626 對 |
|
|
|
|
|
## 使用示例(Python) |
|
|
```python |
|
|
from huggingface_hub import snapshot_download |
|
|
from pathlib import Path |
|
|
from PIL import Image |
|
|
|
|
|
root = Path(snapshot_download("ynyg/InkEraser", repo_type="dataset")) |
|
|
|
|
|
for split in ["train", "val"]: |
|
|
src_dir = root / "data" / split / "source" |
|
|
tgt_dir = root / "data" / split / "target" |
|
|
|
|
|
for src_path in src_dir.glob("*.jpg"): |
|
|
tgt_path = tgt_dir / src_path.name |
|
|
# 成對讀取 |
|
|
src_img = Image.open(src_path) |
|
|
tgt_img = Image.open(tgt_path) |
|
|
# TODO: your training code |
|
|
``` |
|
|
|
|
|
## 授權 |
|
|
Apache-2.0 |