eprakash commited on
Commit
e1580ea
1 Parent(s): 4269813

Update ct_seg_gradio.py

Browse files
Files changed (1) hide show
  1. ct_seg_gradio.py +5 -1
ct_seg_gradio.py CHANGED
@@ -7,7 +7,7 @@ from PIL import Image
7
  from huggingface_hub import HfApi
8
  #import torchvision.transforms as transforms
9
 
10
- api = HfApi()
11
 
12
  num_rank = 200
13
  image_prefix = "ct_synthetic_60_large/"
@@ -62,10 +62,12 @@ def find_completed_idxs(save_path=save_path):
62
  return file_list, incorrect_files
63
 
64
  def load_next(rank, img_1, mask_1, img_2, mask_2, img_3, mask_3, img_4, mask_4, example, ids=image_ids, image_prefix=image_prefix, save_path=save_path):
 
65
  api.upload_folder(
66
  folder_path="/home/user/app/ct_seg_ranks",
67
  repo_id="eprakash/gradio",
68
  repo_type="space",)
 
69
  file_list, incorrect_files = find_completed_idxs()
70
  print(str(file_list) + " " + str(incorrect_files))
71
  if (int(example) not in file_list or int(example) in incorrect_files):
@@ -73,10 +75,12 @@ def load_next(rank, img_1, mask_1, img_2, mask_2, img_3, mask_3, img_4, mask_4,
73
  r_fp = open(save_path + "/" + str(int(example)) +".txt", "w")
74
  r_fp.write(r + "\n")
75
  r_fp.close()
 
76
  api.upload_folder(
77
  folder_path="/home/user/app/ct_seg_ranks",
78
  repo_id="eprakash/gradio",
79
  repo_type="space",)
 
80
  file_list, incorrect_files = find_completed_idxs()
81
  if (len(incorrect_files) != 0):
82
  example = incorrect_files[-1]
 
7
  from huggingface_hub import HfApi
8
  #import torchvision.transforms as transforms
9
 
10
+ #api = HfApi()
11
 
12
  num_rank = 200
13
  image_prefix = "ct_synthetic_60_large/"
 
62
  return file_list, incorrect_files
63
 
64
  def load_next(rank, img_1, mask_1, img_2, mask_2, img_3, mask_3, img_4, mask_4, example, ids=image_ids, image_prefix=image_prefix, save_path=save_path):
65
+ '''
66
  api.upload_folder(
67
  folder_path="/home/user/app/ct_seg_ranks",
68
  repo_id="eprakash/gradio",
69
  repo_type="space",)
70
+ '''
71
  file_list, incorrect_files = find_completed_idxs()
72
  print(str(file_list) + " " + str(incorrect_files))
73
  if (int(example) not in file_list or int(example) in incorrect_files):
 
75
  r_fp = open(save_path + "/" + str(int(example)) +".txt", "w")
76
  r_fp.write(r + "\n")
77
  r_fp.close()
78
+ '''
79
  api.upload_folder(
80
  folder_path="/home/user/app/ct_seg_ranks",
81
  repo_id="eprakash/gradio",
82
  repo_type="space",)
83
+ '''
84
  file_list, incorrect_files = find_completed_idxs()
85
  if (len(incorrect_files) != 0):
86
  example = incorrect_files[-1]