GonzaloMG commited on
Commit
4e67073
1 Parent(s): 922bf0f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -19
app.py CHANGED
@@ -34,28 +34,20 @@ css = """
34
  }
35
  """
36
  DEVICE = 'cuda' if torch.cuda.is_available() else 'cpu'
37
- dtype = torch.float32
38
- variant = None
39
- checkpoint_path = "GonzaloMG/marigold-e2e-ft-depth"
40
- unet = UNet2DConditionModel.from_pretrained(checkpoint_path, subfolder="unet")
41
- vae = AutoencoderKL.from_pretrained(checkpoint_path, subfolder="vae")
42
- text_encoder = CLIPTextModel.from_pretrained(checkpoint_path, subfolder="text_encoder")
43
- tokenizer = CLIPTokenizer.from_pretrained(checkpoint_path, subfolder="tokenizer")
44
- scheduler = DDIMScheduler.from_pretrained(checkpoint_path, timestep_spacing="trailing", subfolder="scheduler")
45
- pipe = MarigoldPipeline.from_pretrained(pretrained_model_name_or_path = checkpoint_path,
46
- unet=unet,
47
- vae=vae,
48
- scheduler=scheduler,
49
- text_encoder=text_encoder,
50
- tokenizer=tokenizer,
51
- variant=variant,
52
- torch_dtype=dtype,
53
- )
54
  pipe = pipe.to(DEVICE)
55
  pipe.unet.eval()
56
 
57
-
58
- title = "# End-to-End Fine-Tuned Marigold for Depth Estimation"
59
  description = """ Please refer to our [paper](https://arxiv.org/abs/2409.11355) and [GitHub](https://vision.rwth-aachen.de/diffusion-e2e-ft) for more details."""
60
 
61
  @spaces.GPU
 
34
  }
35
  """
36
  DEVICE = 'cuda' if torch.cuda.is_available() else 'cpu'
37
+ vae = AutoencoderKL.from_pretrained(checkpoint_path, subfolder='vae')
38
+ scheduler = DDIMScheduler.from_pretrained(checkpoint_path, timestep_spacing="trailing", subfolder='scheduler')
39
+ image_encoder = CLIPVisionModelWithProjection.from_pretrained(checkpoint_path, subfolder="image_encoder")
40
+ feature_extractor = CLIPImageProcessor.from_pretrained(checkpoint_path, subfolder="feature_extractor")
41
+ unet = UNet2DConditionModel.from_pretrained(checkpoint_path, subfolder="unet")
42
+ pipe = DepthNormalEstimationPipeline(vae=vae,
43
+ image_encoder=image_encoder,
44
+ feature_extractor=feature_extractor,
45
+ unet=unet,
46
+ scheduler=scheduler)
 
 
 
 
 
 
 
47
  pipe = pipe.to(DEVICE)
48
  pipe.unet.eval()
49
 
50
+ title = "# End-to-End Fine-Tuned GeoWizard"
 
51
  description = """ Please refer to our [paper](https://arxiv.org/abs/2409.11355) and [GitHub](https://vision.rwth-aachen.de/diffusion-e2e-ft) for more details."""
52
 
53
  @spaces.GPU