seedmanc commited on
Commit
2898bf9
1 Parent(s): 14977c1

Update opp.py

Browse files
Files changed (1) hide show
  1. opp.py +6 -5
opp.py CHANGED
@@ -137,7 +137,7 @@ def predict(image):
137
 
138
  #@title Wrapper & stats { form-width: "10%" }
139
  DEBUG = True #@param {type:"boolean"}
140
- autoclearLog = False #@param {type:"boolean"}
141
  import csv
142
  import sys
143
  import gradio as gr
@@ -370,8 +370,8 @@ def writeScores(table, files): # => csv_output, stats_output, stats_toggle
370
  return [gr.update(value=scan()), *list(showStats)]
371
 
372
  #@title GUI { vertical-output: true, form-width: "50%", display-mode: "both" }
373
- tableQueued_False = False #@param {type:"boolean"}
374
- queueConcurrency_2 = 2 #@param {type:"integer", min:1}
375
  queueUpdateInterval_0 = 0 #@param {type:"slider", min:0, max:10, step:0.2}
376
  prevent_thread_lock = False #@param {type:"boolean"}
377
  #@markdown tableQueued == True + queueConcurrency == 1 guarantees stalling on CPU
@@ -386,6 +386,7 @@ prevent_thread_lock = False #@param {type:"boolean"}
386
  #@markdown effects on speed & stability unknown
387
  if DEBUG:
388
  import shutil #i doshutilsya
 
389
 
390
  if writeClip: # disabled in v1
391
  for root, dirs, files in os.walk('CLIPped'):
@@ -449,7 +450,7 @@ def toggleRun(files): # => submit, dataframe, status
449
  if eta:
450
  log('INTERRUPTED at ss remaining (extra)', eta)
451
  resetStatus()
452
- if (DEBUG and autoclearLog):
453
  os.system('clear')
454
  print('\r')
455
 
@@ -464,7 +465,7 @@ with blks as demo:
464
  with gr.Accordion('README', open=False):
465
  gr.Markdown(description)
466
  if DEBUG and not autoclearLog:
467
- gr.Button('Clear logs').click(lambda: print("\033[H\033[3J", end="")) #debug
468
  with gr.Row().style(equal_height=False):
469
  with gr.Column(scale=2):
470
  imageinput = gr.Files(file_types=["image"], label="Add images", elem_id="addimg")
 
137
 
138
  #@title Wrapper & stats { form-width: "10%" }
139
  DEBUG = True #@param {type:"boolean"}
140
+ autoclearLog = True #@param {type:"boolean"}
141
  import csv
142
  import sys
143
  import gradio as gr
 
370
  return [gr.update(value=scan()), *list(showStats)]
371
 
372
  #@title GUI { vertical-output: true, form-width: "50%", display-mode: "both" }
373
+ tableQueued_False = True #@param {type:"boolean"}
374
+ queueConcurrency_2 = 1 #@param {type:"integer", min:1}
375
  queueUpdateInterval_0 = 0 #@param {type:"slider", min:0, max:10, step:0.2}
376
  prevent_thread_lock = False #@param {type:"boolean"}
377
  #@markdown tableQueued == True + queueConcurrency == 1 guarantees stalling on CPU
 
386
  #@markdown effects on speed & stability unknown
387
  if DEBUG:
388
  import shutil #i doshutilsya
389
+ import subprocess
390
 
391
  if writeClip: # disabled in v1
392
  for root, dirs, files in os.walk('CLIPped'):
 
450
  if eta:
451
  log('INTERRUPTED at ss remaining (extra)', eta)
452
  resetStatus()
453
+ if DEBUG:# and autoclearLog):
454
  os.system('clear')
455
  print('\r')
456
 
 
465
  with gr.Accordion('README', open=False):
466
  gr.Markdown(description)
467
  if DEBUG and not autoclearLog:
468
+ gr.Button('Clear logs').click(lambda: subprocess.call("clear")) #debug
469
  with gr.Row().style(equal_height=False):
470
  with gr.Column(scale=2):
471
  imageinput = gr.Files(file_types=["image"], label="Add images", elem_id="addimg")