multimodalart HF Staff commited on
Commit
a86e9ef
·
verified ·
1 Parent(s): 48f70df

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -133,19 +133,21 @@ pipeline = PPMemImageToVideoPipeline(
133
  encoder = LatentEncoder(vae, device=DEVICE, dtype=DTYPE)
134
 
135
 
136
- # The repo binds InferenceEngine.encode_depth_to_latent AND normalize_depth to a
137
- # plain function taking `self` with .vae/.model_dtype/.device; encode_depth_to_latent
138
- # calls self.normalize_depth internally (depth_latent.py:88), so bind BOTH to a host
139
- # object the same way the reference's InferenceEngine does.
 
140
  class _DepthCodec:
141
- normalize_depth = staticmethod(_depth_latent.normalize_depth.__wrapped__) if hasattr(_depth_latent.normalize_depth, "__wrapped__") else staticmethod(_depth_latent.normalize_depth.__func__)
 
142
 
143
 
144
  codec = _DepthCodec()
145
  codec.vae = vae
146
  codec.model_dtype = DTYPE
147
  codec.device = DEVICE
148
- encode_depth_to_latent = depth_latent.encode_depth_to_latent.__get__(codec)
149
 
150
  moge = None # lazy: bundled examples ship geometry.npz and never touch MoGe
151
 
 
133
  encoder = LatentEncoder(vae, device=DEVICE, dtype=DTYPE)
134
 
135
 
136
+ # The repo binds InferenceEngine.encode_depth_to_latent AND normalize_depth to the
137
+ # plain `self`-taking functions (engine/builder.py:115-116: `InferenceEngine.normalize_depth
138
+ # = depth_latent.normalize_depth`); encode_depth_to_latent calls self.normalize_depth
139
+ # internally (depth_latent.py:88). Mirror that assignment on a host object exactly:
140
+ # plain-function class attributes bind as methods, so `self` resolves correctly.
141
  class _DepthCodec:
142
+ normalize_depth = _depth_latent.normalize_depth
143
+ encode_depth_to_latent = _depth_latent.encode_depth_to_latent
144
 
145
 
146
  codec = _DepthCodec()
147
  codec.vae = vae
148
  codec.model_dtype = DTYPE
149
  codec.device = DEVICE
150
+ encode_depth_to_latent = codec.encode_depth_to_latent
151
 
152
  moge = None # lazy: bundled examples ship geometry.npz and never touch MoGe
153