matteomarjanovic commited on
Commit
db8ace2
·
1 Parent(s): 099a349

remove titles

Browse files
Files changed (1) hide show
  1. app.py +22 -21
app.py CHANGED
@@ -35,26 +35,26 @@ def encode_image(image_path):
35
  return base64.b64encode(image_file.read()).decode('utf-8')
36
 
37
 
38
- @spaces.GPU #[uncomment to use ZeroGPU]
39
- def infer(
40
- prompt,
41
- progress=gr.Progress(track_tqdm=True),
42
- ):
43
- # seed = random.randint(0, MAX_SEED)
44
-
45
- # generator = torch.Generator().manual_seed(seed)
46
-
47
- image = pipe(
48
- prompt=prompt,
49
- guidance_scale=0.,
50
- num_inference_steps=4,
51
- width=1420,
52
- height=1080,
53
- max_sequence_length=256,
54
 
55
- ).images[0]
56
 
57
- return image
58
 
59
  @spaces.GPU #[uncomment to use ZeroGPU]
60
  def generate_description_fn(
@@ -118,17 +118,18 @@ css = """
118
  # generated_prompt = ""
119
 
120
  with gr.Blocks(css=css) as demo:
121
- gr.Markdown("# Draptic: from garment image to technical flat sketch")
122
  with gr.Row():
123
  with gr.Column(elem_id="col-input-image"):
124
- gr.Markdown(" ## Drop your image here")
125
  input_image = gr.Image(type="filepath")
126
  with gr.Column(elem_id="col-container"):
127
  generate_button = gr.Button("Generate flat sketch", scale=0, variant="primary")
128
 
129
  result = gr.Image(label="Result", show_label=False)
130
 
131
- gr.Markdown("## Description of the garment:")
 
132
  generated_prompt = gr.Markdown("")
133
 
134
  gr.on(
 
35
  return base64.b64encode(image_file.read()).decode('utf-8')
36
 
37
 
38
+ # @spaces.GPU #[uncomment to use ZeroGPU]
39
+ # def infer(
40
+ # prompt,
41
+ # progress=gr.Progress(track_tqdm=True),
42
+ # ):
43
+ # # seed = random.randint(0, MAX_SEED)
44
+
45
+ # # generator = torch.Generator().manual_seed(seed)
46
+
47
+ # image = pipe(
48
+ # prompt=prompt,
49
+ # guidance_scale=0.,
50
+ # num_inference_steps=4,
51
+ # width=1420,
52
+ # height=1080,
53
+ # max_sequence_length=256,
54
 
55
+ # ).images[0]
56
 
57
+ # return image
58
 
59
  @spaces.GPU #[uncomment to use ZeroGPU]
60
  def generate_description_fn(
 
118
  # generated_prompt = ""
119
 
120
  with gr.Blocks(css=css) as demo:
121
+ # gr.Markdown("# Draptic: from garment image to technical flat sketch")
122
  with gr.Row():
123
  with gr.Column(elem_id="col-input-image"):
124
+ # gr.Markdown(" ## Drop your image here")
125
  input_image = gr.Image(type="filepath")
126
  with gr.Column(elem_id="col-container"):
127
  generate_button = gr.Button("Generate flat sketch", scale=0, variant="primary")
128
 
129
  result = gr.Image(label="Result", show_label=False)
130
 
131
+ if generated_prompt:
132
+ gr.Markdown("## Description of the garment:")
133
  generated_prompt = gr.Markdown("")
134
 
135
  gr.on(