Upload an image to convert using Waifu2x
468
애니메이션 스타일의 이미지와 애니메이션을 고품질로 업스케일링하고 노이즈 제거를 수행하는 RESTful API 서버입니다. 이 프로젝트는 waifu2x-caffe를 이미지 처리 엔진으로 활용하며, 웹 기반 인터페이스와 API 엔드포인트를 제공합니다.
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update
sudo apt-get install -y nvidia-container-toolkit
sudo systemctl restart docker
version: '3.8'
services:
waifu2x:
image: kamilake/waifu2x-api-server
ports:
- "8080:80"
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
restart: always
docker-compose up -d
서버가 시작되면 http://localhost:8080으로 접속할 수 있습니다.
웹 브라우저에서 http://localhost:8080에 접속하면 아래와 같은 기능을 사용할 수 있습니다:
curl -X POST \
-F "file=@/path/to/your/image.jpg" \
-F "mode=noise_scale" \
-F "noise_level=1" \
-F "scale_mode=ratio" \
-F "scale_ratio=2.0" \
-F "process=gpu" \
-F "output_format=png" \
-o output.png \
http://localhost:8080/api/v1/process
curl -X POST \
-F "file=@/path/to/your/image.jpg" \
-F "mode=noise_scale" \
-F "scale_mode=width" \
-F "scale_width=1920" \
-o output.png \
http://localhost:8080/api/v1/process
curl -X POST \
-F "file=@/path/to/your/image.jpg" \
-F "mode=noise_scale" \
-F "scale_mode=height" \
-F "scale_height=1080" \
-o output.png \
http://localhost:8080/api/v1/process
curl -X POST \
-F "[email protected]" \
-F "mode=noise_scale" \
-F "noise_level=1" \
-F "output_format=gif" \
-o enhanced.gif \
http://localhost:8080/api/v1/process
curl -X POST \
-F "[email protected]" \
-F "mode=noise" \
-F "noise_level=2" \
-F "output_format=webp" \
-o enhanced.webp \
http://localhost:8080/api/v1/process
curl http://localhost:8080/api/v1/options
| 매개변수 | 설명 | 값 | 기본값 |
|---|---|---|---|
file | 처리할 이미지 파일 | 이미지 파일 | (필수) |
mode | 처리 모드 | noise, scale, noise_scale, auto_scale | noise_scale |
noise_level | 노이즈 제거 레벨 | 0, 1, 2, 3 | 1 |
scale_mode | 스케일링 방식 | ratio, width, height | ratio |
scale_ratio | 확대 비율 | 0.1 이상의 숫자 | 2.0 |
scale_width | 출력 너비(픽셀) | 숫자 | - |
scale_height | 출력 높이(픽셀) | 숫자 | - |
process | 처리 방법 | cpu, gpu, cudnn | gpu |
tta | TTA 모드 사용 | 0, 1 | 0 |
output_format | 출력 형식 | png, jpg, webp, gif | png |
이 서버는 다음과 같은 과정으로 이미지를 처리합니다:
process_imageprocess_gifprocess_webp소스코드에서 직접 이미지를 빌드하려면:
docker-compose build를 실행합니다.docker-compose up -d로 서버를 시작합니다.MIT License
git checkout -b my-new-featuregit commit -am 'Add some feature'git push origin my-new-feature문제나 제안사항이 있으시면 GitHub 이슈를 통해 알려주세요.
라이선스 유형이 2개인 유사한 코드가 있습니다.
Content type
Image
Digest
sha256:14f75e9f4…
Size
7.3 GB
Last updated
9 months ago
docker pull kamilake/waifu2x-api-server