abreza commited on
Commit
1f65c6b
·
1 Parent(s): 8d823b9
Files changed (1) hide show
  1. app.py +3 -29
app.py CHANGED
@@ -10,29 +10,6 @@ import os
10
  import requests
11
  import csv
12
  import spaces
13
- # from triton.fb import build_paths
14
-
15
- # from torch.utils.cpp_extension import load
16
-
17
- # # Compile and load the CUDA extension
18
- # adaptive_conv_cuda_impl = load(
19
- # name='adaptive_conv_cuda_impl',
20
- # sources=[
21
- # 'featup/adaptive_conv_cuda/adaptive_conv_cuda.cpp',
22
- # 'featup/adaptive_conv_cuda/adaptive_conv_kernel.cu'
23
- # ],
24
- # extra_cflags=['-O3'],
25
- # extra_cuda_cflags=['-O3']
26
- # )
27
-
28
- # # Compile and load the C++ extension
29
- # adaptive_conv_cpp_impl = load(
30
- # name='adaptive_conv_cpp_impl',
31
- # sources=['featup/adaptive_conv_cuda/adaptive_conv.cpp'],
32
- # extra_cflags=['-O3']
33
- # )
34
-
35
- # print(adaptive_conv_cuda_impl, adaptive_conv_cpp_impl)
36
 
37
  def plot_feats(image, lr, hr):
38
  from featup.util import pca, remove_axes
@@ -112,12 +89,9 @@ model_option = gr.Radio(options, value="dino16",
112
 
113
  @spaces.GPU
114
  def upsample_features(image, model_option):
115
-
116
- output = subprocess.check_output(['ls', '/']).decode()
117
- print(output)
118
- print(torch.version.cuda)
119
- cuda_version = subprocess.run(['nvcc', '--version'], stdout=subprocess.PIPE)
120
- print(cuda_version.stdout.decode('utf-8'))
121
 
122
  from featup.util import norm, unnorm
123
  models = {o: torch.hub.load("mhamilton723/FeatUp", o) for o in options}
 
10
  import requests
11
  import csv
12
  import spaces
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
  def plot_feats(image, lr, hr):
15
  from featup.util import pca, remove_axes
 
89
 
90
  @spaces.GPU
91
  def upsample_features(image, model_option):
92
+
93
+ subprocess.check_call(
94
+ ["pip", "install", "git+https://github.com/mhamilton723/FeatUp"])
 
 
 
95
 
96
  from featup.util import norm, unnorm
97
  models = {o: torch.hub.load("mhamilton723/FeatUp", o) for o in options}