Kyo-Kai commited on
Commit
3ace2f0
1 Parent(s): 21e5e25

Update Fsg_pp.py

Browse files
Files changed (1) hide show
  1. Fsg_pp.py +10 -8
Fsg_pp.py CHANGED
@@ -25,16 +25,9 @@ class ImageGallery:
25
 
26
  def return_images(self, image_locs):
27
  self.imgz = image_locs
28
-
29
- total_images = len(glob.glob('./Images/*'))
30
- if total_images >= 20:
31
- os.system("rm -r ./Images")
32
- os.makedirs("./Images")
33
-
34
- # Log the return value
35
- logging.info(self.imgz)
36
  return self.imgz if self.imgz else []
37
 
 
38
  def get_select_index(self, evt: gr.SelectData):
39
  self.selected = evt.index
40
  return self.selected
@@ -85,6 +78,15 @@ def create_gallery_tab(tab_name, search_fn, search_inputs, gallery_instance, fn_
85
  with gr.Column():
86
  gallery=gr.Gallery(label="Image Preview", preview=True, object_fit="cover", container=True, columns=5)
87
 
 
 
 
 
 
 
 
 
 
88
  with gr.Row():
89
  crop_btn = gr.Button(value="Crop Selected Image",variant='secondary')
90
  crop_btn.click(fn=fn_on_click, outputs=[image,tabs])
 
25
 
26
  def return_images(self, image_locs):
27
  self.imgz = image_locs
 
 
 
 
 
 
 
 
28
  return self.imgz if self.imgz else []
29
 
30
+
31
  def get_select_index(self, evt: gr.SelectData):
32
  self.selected = evt.index
33
  return self.selected
 
78
  with gr.Column():
79
  gallery=gr.Gallery(label="Image Preview", preview=True, object_fit="cover", container=True, columns=5)
80
 
81
+ total_images = len(glob.glob('./Images/*'))
82
+ if total_images >= 20:
83
+ os.system("rm -r ./Images")
84
+ os.makedirs("./Images")
85
+
86
+ # Log the return value
87
+ logging.info(gallery_instance.imgz)
88
+
89
+
90
  with gr.Row():
91
  crop_btn = gr.Button(value="Crop Selected Image",variant='secondary')
92
  crop_btn.click(fn=fn_on_click, outputs=[image,tabs])