Skip to content

Commit

Permalink
0908 live stream version (modelscope#199)
Browse files Browse the repository at this point in the history
* 0908_live_stream_version, High performance inpainting for single & double person, Simplify User Interface.

Co-authored-by: 诚公 <[email protected]>
  • Loading branch information
You-Cun and You-Cun authored Sep 9, 2023
1 parent 44669b3 commit 1105d46
Show file tree
Hide file tree
Showing 14 changed files with 1,092 additions and 26 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ FaceChain is powered by [ModelScope](https://github.com/modelscope/modelscope).


![image](resources/git_cover.jpg)
![image](resources/git_cover_1.png)
![image](resources/git_cover_1.jpg)
![image](resources/git_cover_2.jpg)


# News
- High performance inpainting for single & double person, Simplify User Interface. (September 09th, 2023 UTC)
- More Technology Details can be seen in [Paper](https://arxiv.org/abs/2308.14256). (August 30th, 2023 UTC)
- Add validate & ensemble for Lora training, and InpaintTab(hide in gradio for now). (August 28th, 2023 UTC)
- Add pose control module. (August 27th, 2023 UTC)
Expand Down
4 changes: 3 additions & 1 deletion README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ FaceChain的模型由[ModelScope](https://github.com/modelscope/modelscope)开
<br>

![image](resources/git_cover_CH.jpg)
![image](resources/git_cover_1.png)
![image](resources/git_cover_1.jpg)
![image](resources/git_cover_2.jpg)


# News
- 高性能的(单人&双人)模版重绘功能,简化用户界面. (2023-09-09)
- 更多技术细节可以在 [论文](https://arxiv.org/abs/2308.14256) 里查看. (2023-08-30)
- 为Lora训练添加验证和根据face_id的融合,并添加InpaintTab(目前在Gradio界面上暂时默认隐藏). (2023-08-28)
- 增加姿势控制模块,可一键体验模版pose复刻. (2023-08-27)
Expand Down
254 changes: 232 additions & 22 deletions app.py

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions facechain/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,11 @@ def compress_image(input_path, target_size):
image = cv2.imread(input_path)

quality = 95
while cv2.imencode('.jpg', image, [cv2.IMWRITE_JPEG_QUALITY, quality])[1].size > target_size:
quality -= 5
try:
while cv2.imencode('.jpg', image, [cv2.IMWRITE_JPEG_QUALITY, quality])[1].size > target_size:
quality -= 5
except:
import pdb;pdb.set_trace()

compressed_image = cv2.imencode('.jpg', image, [cv2.IMWRITE_JPEG_QUALITY, quality])[1].tostring()

Expand Down
849 changes: 849 additions & 0 deletions facechain/inference_ipt.py

Large diffs are not rendered by default.

Binary file added resources/git_cover_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed resources/git_cover_1.png
Binary file not shown.
Binary file added resources/git_cover_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed resources/inpaint_template/0.jpg
Binary file not shown.
Binary file modified resources/inpaint_template/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/inpaint_template/2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/inpaint_template/3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/inpaint_template/4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/inpaint_template/5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1105d46

Please sign in to comment.