colin1842 commited on
Commit
00c0e7f
·
verified ·
1 Parent(s): 1ce16d5

Upload script.py

Browse files
Files changed (1) hide show
  1. script.py +24 -1
script.py CHANGED
@@ -101,7 +101,28 @@ def convert_entry_to_human_readable(entry):
101
  '''---end of compulsory---'''
102
 
103
  ### The part below is used to define and test your solution.
104
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  from pathlib import Path
106
  def save_submission(submission, path):
107
  """
@@ -116,6 +137,8 @@ def save_submission(submission, path):
116
  print(f"Submission saved to {path}")
117
 
118
  if __name__ == "__main__":
 
 
119
  from handcrafted_solution import predict
120
  print ("------------ Loading dataset------------ ")
121
  params = hoho.get_params()
 
101
  '''---end of compulsory---'''
102
 
103
  ### The part below is used to define and test your solution.
104
+ import subprocess
105
+ import sys
106
+ import os
107
+ def setup_environment():
108
+ subprocess.check_call([sys.executable, "-m", "pip", "install", "git+http://hf.co/usm3d/tools.git"])
109
+ import hoho
110
+ hoho.setup()
111
+
112
+ subprocess.check_call([sys.executable, "-m", "pip", "install", "torch==2.0.1", "torchvision==0.15.2", "torchaudio==2.0.2", "-f", "https://download.pytorch.org/whl/cu117.html"])
113
+ subprocess.check_call([sys.executable, "-m", "pip", "install", "scikit-learn"])
114
+ subprocess.check_call([sys.executable, "-m", "pip", "install", "tqdm"])
115
+ subprocess.check_call([sys.executable, "-m", "pip", "install", "scipy"])
116
+ subprocess.check_call([sys.executable, "-m", "pip", "install", "open3d"])
117
+ subprocess.check_call([sys.executable, "-m", "pip", "install", "easydict"])
118
+
119
+ pc_util_path = os.path.join(os.getcwd(), 'pc_util')
120
+ if os.path.isdir(pc_util_path):
121
+ os.chdir(pc_util_path)
122
+ subprocess.check_call([sys.executable, "setup.py", "install"])
123
+ else:
124
+ print(f"Directory {pc_util_path} does not exist")
125
+
126
  from pathlib import Path
127
  def save_submission(submission, path):
128
  """
 
137
  print(f"Submission saved to {path}")
138
 
139
  if __name__ == "__main__":
140
+ setup_environment()
141
+
142
  from handcrafted_solution import predict
143
  print ("------------ Loading dataset------------ ")
144
  params = hoho.get_params()