Metadata-Version: 2.1
Name: imageBuild
Version: 0.2.3
Summary: 使用超分辨率来对图像进行重建
Home-page: https://github.com/mute23-code/imageBuild
Author: mute.
Author-email: mute23@qq.com
License: MITBSD-3-Clause License
Platform: all
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Natural Language :: Chinese (Simplified)
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.7
Classifier: Topic :: Software Development :: Libraries
Description-Content-Type: text/markdown
License-File: LICENSE

---
title: imageBuild
emoji: 🏃
colorFrom: blue
colorTo: blue
sdk: gradio
sdk_version: 0.2.3.0
app_file: app.py
pinned: false
---

# imageBuild

该功能是使用超分辨率来对图像进行重建，可以简单理解成让图片变大变清晰。

## 效果

重建前 与 重建后  

<img src="https://mute23-code.github.io/blogImage/imageBuild-demo/demo.jpg" width="200">
<img src="https://mute23-code.github.io/blogImage/imageBuild-demo/demo(build).jpg" width="200">


## 食用方法 - Hugging Face

> **简单介绍下 Hugging Face**  
> 中文名：拥抱脸 ，英文名就和这个表情包一样🤗同样的名字。  
> Hugging Face 在国内应用非常广泛，入门者可以用它快速用得上科研大牛们训练出的超牛模型，你甚至不需要知道什么是GPT，BERT就可以用他的模型了

Hugging Face 官网：[https://huggingface.co/](https://huggingface.co/)

### 安装拥抱脸

* 使用 pip 安装  
（不建议从 pip 安装，推荐将源码部署在 [huggingface](https://huggingface.co/) 中使用，简单快捷）
```
pip install imageBuild
```
* 从 Github 安装
```
git clone https://github.com/mute23-code/imageBuild.git
```

* 从 HuggingFace 安装
```
git clone https://huggingface.co/mute23/imageBuild
```
别忘了切换文件夹 `cd imageBuild`


### 下载 huggingface hub Cli
```cmd
pip install huggingface_hub
```

## 登录
```cmd
huggingface-cli login
```

## 创建存储库
和 Github 差不多，不多赘述  
[点此创建](huggingface.co/new)

## 添加存储库

```git
git lfs install
```

## 推送
```git
git add .
git commit -f "first commit"
git push
```

到此，你的图像重建的工具就搭建完成了，拥抱脸贴心的为你准备了api，你也可以通过它实现图像重建。不过，由于使用api，线上算力存在限制，所以调用的是较小的模型，导致线上的模型似乎没有本地推断那么好，事实上，效果差距还是很大的。想要获得更好的重建效果，还是得靠你刚才搭建的程序
```
API = "https://hf.space/embed/{你的id名}/{你的仓库名}/api/predict/"
```

## 鸣谢

* [xinntao/Real-ESRGAN](https://github.com/xinntao/Real-ESRGAN) 超分辨率原理便是基于该仓库
* [ppxxxg22/nonebot_plugin_RealESRGAN](https://github.com/ppxxxg22/nonebot_plugin_RealESRGAN) 提供了封装后的执行文件

