jgerbscheid commited on
Commit
4c9bba2
1 Parent(s): 01e5b1c

removed os terminal size line that caused error

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -8,7 +8,8 @@ def annotate_file(file_objects, model_type):
8
  # TODO: actually use different model types based on selected model, only a well trained dijk model is available now.
9
  generated_charfiles = []
10
  str1 = "Starting processing of files."
11
- pad1 = math.floor((os.get_terminal_size().columns - len(str1)) / 2) * "="
 
12
  print(pad1 + "Starting processing of files." + pad1)
13
  for i, file_obj in enumerate(file_objects):
14
  target_filepath = f"/tmp/characteristicpoints_{i}.csv"
@@ -16,7 +17,8 @@ def annotate_file(file_objects, model_type):
16
  dijkprofile_annotator.annotate(file_obj.name, target_filepath, device='cpu')
17
  generated_charfiles.append(target_filepath)
18
  print(f" finished processing: {file_obj.name}! saved to : {target_filepath}")
19
- print(" ", "-" * (os.get_terminal_size().columns - 5))
 
20
 
21
  print("finished with all processing!")
22
  # return the csv file if only 1 file was given, return a zip otherwise.
@@ -42,4 +44,4 @@ iface = gr.Interface(
42
  description=description,
43
  inputs=[gr.inputs.File(file_count="multiple", type="file", label="te annoteren surfacelines files", optional=False), gr.inputs.Dropdown(['dijk', 'dijk+sloot', "volledig"], type="value", default=None, label='Model type')],
44
  outputs=gr.outputs.File(label="gegenereerde file"))
45
- iface.launch()
 
8
  # TODO: actually use different model types based on selected model, only a well trained dijk model is available now.
9
  generated_charfiles = []
10
  str1 = "Starting processing of files."
11
+ # pad1 = math.floor((os.get_terminal_size().columns - len(str1)) / 2) * "="
12
+ pad1 = 30
13
  print(pad1 + "Starting processing of files." + pad1)
14
  for i, file_obj in enumerate(file_objects):
15
  target_filepath = f"/tmp/characteristicpoints_{i}.csv"
 
17
  dijkprofile_annotator.annotate(file_obj.name, target_filepath, device='cpu')
18
  generated_charfiles.append(target_filepath)
19
  print(f" finished processing: {file_obj.name}! saved to : {target_filepath}")
20
+ print(" ", "-" * (pad1 - 5))
21
+
22
 
23
  print("finished with all processing!")
24
  # return the csv file if only 1 file was given, return a zip otherwise.
 
44
  description=description,
45
  inputs=[gr.inputs.File(file_count="multiple", type="file", label="te annoteren surfacelines files", optional=False), gr.inputs.Dropdown(['dijk', 'dijk+sloot', "volledig"], type="value", default=None, label='Model type')],
46
  outputs=gr.outputs.File(label="gegenereerde file"))
47
+ iface.launch()