svjack commited on
Commit
a53cdcc
1 Parent(s): 3ae8d58

Rename control_app.py to app.py

Browse files
Files changed (1) hide show
  1. control_app.py → app.py +0 -63
control_app.py → app.py RENAMED
@@ -1,10 +1,3 @@
1
- '''
2
- !git clone https://huggingface.co/spaces/radames/SPIGA-face-alignment-headpose-estimator
3
- !cp -r SPIGA-face-alignment-headpose-estimator/SPIGA .
4
- !pip install -r SPIGA/requirements.txt
5
- !pip install datasets
6
- !huggingface-cli login
7
- '''
8
  from pred_color import *
9
  import gradio as gr
10
 
@@ -73,59 +66,3 @@ examples=example_sample if example_sample else None,
73
  )
74
  gr.launch(share=False)
75
 
76
- if __name__ == "__main__":
77
- '''
78
- control_image = load_image("./conditioning_image_1.png")
79
- prompt = "戴眼镜的中年男子"
80
- # generate image
81
- generator = torch.manual_seed(0)
82
- image = pipe(
83
- prompt, num_inference_steps=50, generator=generator, image=control_image
84
- ).images[0]
85
- image
86
-
87
- control_image = load_image("./conditioning_image_1.png")
88
- prompt = "穿蓝色衣服的秃头男子"
89
- # generate image
90
- generator = torch.manual_seed(0)
91
- image = pipe(
92
- prompt, num_inference_steps=50, generator=generator, image=control_image
93
- ).images[0]
94
- image
95
-
96
- control_image = load_image("./conditioning_image_2.png")
97
- prompt = "金色头发的美丽女子"
98
- # generate image
99
- generator = torch.manual_seed(0)
100
- image = pipe(
101
- prompt, num_inference_steps=50, generator=generator, image=control_image
102
- ).images[0]
103
- image
104
-
105
- control_image = load_image("./conditioning_image_2.png")
106
- prompt = "绿色运动衫的男子"
107
- # generate image
108
- generator = torch.manual_seed(0)
109
- image = pipe(
110
- prompt, num_inference_steps=50, generator=generator, image=control_image
111
- ).images[0]
112
- image
113
-
114
- from huggingface_hub import HfApi
115
- hf_api = HfApi()
116
-
117
- hf_api.upload_file(
118
- path_or_fileobj = "TSD_save_only/diffusion_pytorch_model.bin",
119
- path_in_repo = "diffusion_pytorch_model.bin",
120
- repo_id = "svjack/ControlNet-Face-Zh",
121
- repo_type = "model",
122
- )
123
-
124
- hf_api.upload_file(
125
- path_or_fileobj = "TSD_save_only/config.json",
126
- path_in_repo = "config.json",
127
- repo_id = "svjack/ControlNet-Face-Zh",
128
- repo_type = "model",
129
- )
130
- '''
131
- pass
 
 
 
 
 
 
 
 
1
  from pred_color import *
2
  import gradio as gr
3
 
 
66
  )
67
  gr.launch(share=False)
68