Leon Sick commited on
Commit
f61539c
1 Parent(s): f7a79fa

start of space

Browse files
Files changed (2) hide show
  1. Dockerfile +1 -1
  2. model.py +2 -0
Dockerfile CHANGED
@@ -48,7 +48,7 @@ RUN pip install --no-cache-dir -U \
48
  opencv-python-headless==4.8.0.74 \
49
  Pillow==9.5.0 \
50
  colored==1.4.4
51
- RUN pip install --no-cache-dir -U gradio==3.37.0
52
 
53
  COPY --chown=1000 . ${HOME}/app
54
  RUN git clone https://github.com/facebookresearch/CutLER.git
 
48
  opencv-python-headless==4.8.0.74 \
49
  Pillow==9.5.0 \
50
  colored==1.4.4
51
+ RUN pip install --no-cache-dir -U gradio==4.43.0
52
 
53
  COPY --chown=1000 . ${HOME}/app
54
  RUN git clone https://github.com/facebookresearch/CutLER.git
model.py CHANGED
@@ -91,6 +91,7 @@ def load_model(score_threshold: float) -> VisualizationDemo:
91
  model_dir.mkdir(exist_ok=True)
92
  weight_path = model_dir / WEIGHT_URL.split('/')[-1]
93
  print("***weight_path***", weight_path)
 
94
 
95
  if not weight_path.exists():
96
  subprocess.run(shlex.split(f'wget {WEIGHT_URL} -O {weight_path}'))
@@ -122,4 +123,5 @@ def run_model(image_path: str, score_threshold: float = 0.5) -> np.ndarray:
122
  _, res = model.run_on_image(image)
123
  print("***END***")
124
  print("***res.get_image()***", res.get_image())
 
125
  return res.get_image()
 
91
  model_dir.mkdir(exist_ok=True)
92
  weight_path = model_dir / WEIGHT_URL.split('/')[-1]
93
  print("***weight_path***", weight_path)
94
+ print("torch.cuda.is_available()", torch.cuda.is_available())
95
 
96
  if not weight_path.exists():
97
  subprocess.run(shlex.split(f'wget {WEIGHT_URL} -O {weight_path}'))
 
123
  _, res = model.run_on_image(image)
124
  print("***END***")
125
  print("***res.get_image()***", res.get_image())
126
+ print("***type(res.get_image())***", type(res.get_image()))
127
  return res.get_image()