Spaces:
Running
Running
File size: 3,315 Bytes
a56ad34 13aa528 a56ad34 13aa528 a56ad34 13aa528 a56ad34 13aa528 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
---
title: Webtoon Lineart Cropper
emoji: ๐ค
colorFrom: yellow
colorTo: blue
sdk: gradio
sdk_version: 5.25.2
app_file: app.py
python_version: 3.12.10
pinned: false
---
# Helix-Painting Data Tool
์นํฐ PSD ํ์ผ์ ์ด๋ฏธ์ง ํ์ผ(PNG)๋ก ๋ณํํ๊ณ , ์ปท ์ถ์ถ ๋ฐ ์ธ๋ฌผ ๊ฒ์ถ ๋ฑ์ ํตํด ๋ฐ์ดํฐ๋ฅผ ์ถ์ถํ๋ ๋๊ตฌ์
๋๋ค.
## Prerequisites
[Prerequisites](docs/PREREQUISITES.md)
## Setup a project
[Setup a project](docs/SETUP.md)
## Features
- **PSD โ PNG ๋ณํ**
์นํฐ PSD ํ์ผ์ ๊ณ ํด์๋ PNG ์ด๋ฏธ์ง๋ก ๋ณํํฉ๋๋ค.
- **์ปท ์ถ์ถ ๋ฐ ํํฐ๋ง**
์ด๋ฏธ์ง ๋ด ํฐ์ ์์ญ์ ๊ธฐ์ค์ผ๋ก ์ปท ๋ฐ์ค๋ฅผ ์ถ์ถํ๊ณ , ์ธ๋ฌผ ๊ฒ์ถ(face detector)๊ณผ ํ๊น
(tagger) ๊ธฐ๋ฅ์ ํตํด ์ปท ๋ณ ๋ฐ์ดํฐ๋ฅผ ์์ฑํฉ๋๋ค.
- **๋ณ๋ ฌ ์ฒ๋ฆฌ**
์ฒ๋ฆฌ ์๋๋ฅผ ๋์ด๊ธฐ ์ํด Python์ multiprocessing์ ์ฌ์ฉํ ๋ณ๋ ฌ ์ด๋ฏธ์ง ์ฒ๋ฆฌ ๊ธฐ๋ฅ์ ์ ๊ณตํฉ๋๋ค.
## Usage
### 1. PSD ํ์ผ์ PNG ์ด๋ฏธ์ง๋ก ๋ณํ
`convert_psd_to_png.py` ์คํฌ๋ฆฝํธ๋ฅผ ์ฌ์ฉํ์ฌ PSD ํ์ผ๋ค์ PNG ์ด๋ฏธ์ง๋ก ๋ณํํฉ๋๋ค.
```shell
python scripts/convert_psd_to_png.py --directory <PSD_directory> --output <output_directory> [--visible_layers layer1 layer2 ...] [--invisible_layers layer3 layer4 ...]
```
- `--directory` : PSD ํ์ผ์ ๊ฒ์ํ ๋๋ ํ ๋ฆฌ
- `--output` : ๋ณํ๋ PNG ํ์ผ์ ์ ์ฅํ ๋๋ ํ ๋ฆฌ
- `--visible_layers` / `--invisible_layers` : ๋ณด์ด๊ฑฐ๋ ์จ๊ธธ ๋ ์ด์ด๋ค์ ์ง์
### 2. ์ด๋ฏธ์ง ์ปท ์ถ์ถ ๋ฐ ํํฐ๋ง
`parse_cut_from_page.py` ์คํฌ๋ฆฝํธ๋ฅผ ์ฌ์ฉํ์ฌ ์ปท ๋ฐ์ค๋ฅผ ์ถ์ถํ๊ณ , ๊ฐ ์ปท์ ๋ํด ํํฐ๋ง๋ ๋ฐ์ดํฐ๋ฅผ ์์ฑํฉ๋๋ค.
```shell
python scripts/parse_cut_from_page.py --lineart <lineart_directory> --flat <flat_directory> --segmentation <segmentation_directory> --color <color_directory> --output <output_directory> [--num_process <number_of_processes>]
```
- `--lineart` : ๋ผ์ธ์ํธ ์ด๋ฏธ์ง๊ฐ ์ ์ฅ๋ ๋๋ ํ ๋ฆฌ
- `--flat` : ์ฑ์ ์ ํ๋ฉด ์ด๋ฏธ์ง๊ฐ ์ ์ฅ๋ ๋๋ ํ ๋ฆฌ
- `--segmentation` : ์ธ๋ถํ ์ด๋ฏธ์ง๊ฐ ์ ์ฅ๋ ๋๋ ํ ๋ฆฌ
- `--color` : ์ปฌ๋ฌ ์ด๋ฏธ์ง๊ฐ ์ ์ฅ๋ ๋๋ ํ ๋ฆฌ
- `--output` : ์๋ผ๋ธ ์ปท ์ด๋ฏธ์ง๋ฅผ ์ ์ฅํ ๋๋ ํ ๋ฆฌ
- `--num_process` : ๋ณ๋ ฌ ์ฒ๋ฆฌ์ ์ฌ์ฉํ ํ๋ก์ธ์ค ์ (์ ํ๊ฐ)
### 3. ํ๊น
๋ฐ ํํฐ๋ง ์คํ
`run_tag_filter.py` ์คํฌ๋ฆฝํธ๋ฅผ ์ฌ์ฉํ์ฌ ์ด๋ฏธ์ง์ ํ๊น
๋ฐ ํํฐ๋ง์ ์ํํ๊ณ , ๊ฒฐ๊ณผ๋ฅผ ์ ์ฅํฉ๋๋ค.
```shell
python scripts/run_tag_filter.py --input_dir <input_directory> --output_dir <output_directory> [--ext png jpg jpeg]
```
- `--input_dir` : ํํฐ๋งํ ์ด๋ฏธ์ง๋ค์ด ์ ์ฅ๋ ๋๋ ํ ๋ฆฌ
- `--output_dir` : ํํฐ๋ง ๊ฒฐ๊ณผ ์ด๋ฏธ์ง ๋ฐ ์บก์
ํ์ผ์ ์ ์ฅํ ๋๋ ํ ๋ฆฌ
- `--ext` : ์ฒ๋ฆฌํ ์ด๋ฏธ์ง ํ์ฅ์ ๋ชฉ๋ก (๊ธฐ๋ณธ๊ฐ: png)
---
์ด์ ๊ฐ์ด ๊ฐ ์คํฌ๋ฆฝํธ๋ ๋ณ๋์ ์ธ์๋ค์ ๋ฐ์์ ์์
์ ์ํํ๋ฉฐ, ์คํฌ๋ฆฝํธ ๋ด๋ถ์ ๋ก์ง์ ๋ฐ๋ผ PSD ๋ณํ, ์ปท ์ถ์ถ, ์ธ๋ฌผ ๊ฒ์ถ/ํ๊น
, ์บก์
ํ์ผ ์์ฑ ๋ฑ์ ๊ธฐ๋ฅ์ ์ ๊ณตํฉ๋๋ค.
### 4. Gradio ๋ฐ๋ชจ ํ์ด์ง
์๋ ๋ช
๋ ์ด๋ฅผ ์คํํ์ฌ Gradio ๋ฐ๋ชจ ํ์ด์ง๋ก ์ํ๋ PNGํ์ผ์ ์
๋ก๋ํ์ฌ ํํฐ๋ง๋ ์ด๋ฏธ์ง ์ปท ์ถ์ถ ๊ฒฐ๊ณผ๋ฅผ ZIPํ์ผ ํน์ PSDํ์ผ๋ก ํ์ธํ ์ ์์ต๋๋ค.
```shell
python app.py
```
|