ysharma HF staff commited on
Commit
bf83dea
·
1 Parent(s): ae81abd
Files changed (1) hide show
  1. gradio_seg2image.py +4 -12
gradio_seg2image.py CHANGED
@@ -23,9 +23,9 @@ def encode(input_image):
23
 
24
  def create_imgcomp(input_image, filename):
25
  encoded_string = encode(input_image)
26
- htmltag = '<img src= "data:image/jpeg;base64,' + encoded_string + '"/></div> <img src= "https://ysharma-ControlNetSegmentation.hf.space/file=' + filename + '"/>'
27
  #https://ysharma-controlnetsegmentation.hf.space/file=/tmp/tmpqcz9yeta.png
28
-
29
  desc = """
30
  <!DOCTYPE html>
31
  <html lang="en">
@@ -75,16 +75,8 @@ def create_imgcomp(input_image, filename):
75
  <body>
76
  <div style="margin: 3rem;
77
  font-family: Roboto, sans-serif">
78
- <h1 style="color: green">
79
- GeeksforGeeks
80
- </h1>
81
- <h3 style="color: aliceblue">
82
- CSS Image Comparison Slider
83
- </h3>
84
- </div>
85
- <div>
86
- <div class="image-slider">
87
- <div> """ + htmltag + "</div> </div> </body> </html> "
88
  return desc
89
 
90
 
 
23
 
24
  def create_imgcomp(input_image, filename):
25
  encoded_string = encode(input_image)
26
+ htmltag = '<img src= "data:image/jpeg;base64,' + encoded_string + '" alt="Original Image"/></div> <img src= "https://ysharma-ControlNetSegmentation.hf.space/file=' + filename + '" alt="Control Net Image"/>'
27
  #https://ysharma-controlnetsegmentation.hf.space/file=/tmp/tmpqcz9yeta.png
28
+ print(f"htmltag is ^^ - {htmltag}")
29
  desc = """
30
  <!DOCTYPE html>
31
  <html lang="en">
 
75
  <body>
76
  <div style="margin: 3rem;
77
  font-family: Roboto, sans-serif">
78
+ <h1 style="color: green"> Testing image comp</h1>
79
+ </div> <div> <div class="image-slider"> <div> """ + htmltag + "</div> </div> </body> </html> "
 
 
 
 
 
 
 
 
80
  return desc
81
 
82