abreza commited on
Commit
8a31bb3
·
1 Parent(s): c941610
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -1,7 +1,5 @@
1
  import os
2
  import subprocess
3
- from setuptools import setup, find_packages
4
- from torch.utils.cpp_extension import BuildExtension, CUDAExtension, CppExtension
5
 
6
  import matplotlib.pyplot as plt
7
  import torch
@@ -13,6 +11,7 @@ import requests
13
  import csv
14
  import spaces
15
 
 
16
  def plot_feats(image, lr, hr):
17
  from featup.util import pca, remove_axes
18
  assert len(image.shape) == len(lr.shape) == len(hr.shape) == 3
@@ -92,6 +91,12 @@ model_option = gr.Radio(options, value="dino16",
92
  @spaces.GPU(duration=120)
93
  def upsample_features(image, model_option):
94
  with torch.no_grad():
 
 
 
 
 
 
95
  setup(
96
  name='featup',
97
  version='0.1.2',
 
1
  import os
2
  import subprocess
 
 
3
 
4
  import matplotlib.pyplot as plt
5
  import torch
 
11
  import csv
12
  import spaces
13
 
14
+
15
  def plot_feats(image, lr, hr):
16
  from featup.util import pca, remove_axes
17
  assert len(image.shape) == len(lr.shape) == len(hr.shape) == 3
 
91
  @spaces.GPU(duration=120)
92
  def upsample_features(image, model_option):
93
  with torch.no_grad():
94
+ from setuptools import setup, find_packages
95
+ from torch.utils.cpp_extension import BuildExtension, CUDAExtension, CppExtension
96
+ from torch.utils.cpp_extension import _find_cuda_home
97
+
98
+ os.environ['CUDA_HOME'] = _find_cuda_home()
99
+ print(os.environ['CUDA_HOME'])
100
  setup(
101
  name='featup',
102
  version='0.1.2',