Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bubao/fixoldimg
黑白老照片上色
https://github.com/bubao/fixoldimg
cli express gfpgan python
Last synced: 22 days ago
JSON representation
黑白老照片上色
- Host: GitHub
- URL: https://github.com/bubao/fixoldimg
- Owner: bubao
- Created: 2024-10-10T16:21:09.000Z (about 1 month ago)
- Default Branch: master
- Last Pushed: 2024-10-15T15:00:48.000Z (about 1 month ago)
- Last Synced: 2024-10-16T15:56:47.745Z (about 1 month ago)
- Topics: cli, express, gfpgan, python
- Language: Python
- Homepage:
- Size: 73.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# README
![socialify](https://socialify.git.ci/bubao/fixOldImg/image?font=Source%20Code%20Pro&language=1&name=1&owner=1&pattern=Signal&stargazers=1&theme=Auto)
- [Xintao/GFPGAN](https://huggingface.co/spaces/Xintao/GFPGAN)
- [harisreedhar/Face-Upscalers-ONNX](https://github.com/harisreedhar/Face-Upscalers-ONNX)
- [jantic/DeOldify](https://github.com/jantic/DeOldify)## 安装
```shell
python3.10 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
mkdir output
mkdir input
```## 老照片上色&修复
测试表明,先上色在放大效果会好很多
```shell
python fix.py --input=./input/3.webp --output=./output/out25.jpg --version=deoldify
python fix.py --input=./output/out25.jpg --output=./output/out26.jpg --version=v1.4
```## api 调用
这里使用了 Express.js 作为 API 服务,启动命令如下:
```shell
nvm use 22
npm ci
npm start
``````http
POST /api/v1/gfpgan HTTP/1.1
Host: 127.0.0.1:3000
Content-Length: 279
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="version"1.4
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="input"; filename="image.webp"
Content-Type: image/webp(data)
------WebKitFormBoundary7MA4YWxkTrZu0gW--
```