roman-bachmann commited on
Commit
d58b8ba
1 Parent(s): 3f4b0ee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -1,4 +1,11 @@
1
  import os
 
 
 
 
 
 
 
2
  try:
3
  # Try to install detectron2 from source. Needed for semseg plotting functionality.
4
  os.system("python -m pip install 'git+https://github.com/facebookresearch/detectron2.git'")
@@ -6,7 +13,7 @@ except Exception as e:
6
  print('detectron2 cannot be installed. Falling back to simple semseg visualization.')
7
  print(e)
8
 
9
- import torch
10
  # We recommend running this demo on an A100 GPU
11
  if torch.cuda.is_available():
12
  device = "cuda"
@@ -18,11 +25,6 @@ else:
18
  power_device = "CPU"
19
  os.system("pip uninstall -y xformers") # Only use xformers on GPU
20
 
21
- import spaces
22
- import gradio as gr
23
- import random
24
- import numpy as np
25
- from torchvision.transforms.functional import center_crop
26
  from fourm.demo_4M_sampler import Demo4MSampler
27
  from fourm.data.modality_transforms import RGBTransform
28
 
 
1
  import os
2
+ import spaces
3
+ import gradio as gr
4
+ import random
5
+ import numpy as np
6
+ import torch
7
+ from torchvision.transforms.functional import center_crop
8
+
9
  try:
10
  # Try to install detectron2 from source. Needed for semseg plotting functionality.
11
  os.system("python -m pip install 'git+https://github.com/facebookresearch/detectron2.git'")
 
13
  print('detectron2 cannot be installed. Falling back to simple semseg visualization.')
14
  print(e)
15
 
16
+
17
  # We recommend running this demo on an A100 GPU
18
  if torch.cuda.is_available():
19
  device = "cuda"
 
25
  power_device = "CPU"
26
  os.system("pip uninstall -y xformers") # Only use xformers on GPU
27
 
 
 
 
 
 
28
  from fourm.demo_4M_sampler import Demo4MSampler
29
  from fourm.data.modality_transforms import RGBTransform
30