Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -185,4 +185,6 @@ cython_debug/
notebooks
resources/checkpoint/
examples
outputs
outputs
.DS_Store
uv.lock
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ dependencies = [
"jupyter>=1.1.1",
"loguru>=0.7.3",
"matplotlib>=3.10.6",
"mmcv-full>=1.7.2",
"mmcv>=2.0.0,<2.3.0",
"mmengine>=0.10,<0.11",
"notebook>=7.4.7",
"omegaconf>=2.3.0",
"opencv-python>=4.12.0.88",
Expand Down Expand Up @@ -205,6 +206,9 @@ testpaths = [
]
norecursedirs = []
filterwarnings = []
[tool.uv.extra-build-dependencies]
clip = ["setuptools<82"]
mmcv = ["setuptools<82"]

[tool.uv.sources]
clip = { git = "https://github.com/openai/CLIP.git" }
17 changes: 3 additions & 14 deletions src/demark_world/models/model/modules/feat_prop.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,14 @@

import torch
import torch.nn as nn
from mmengine.model import constant_init

try:
from mmcv.cnn import constant_init
from mmcv.ops import ModulatedDeformConv2d, modulated_deform_conv2d
except:
except Exception as exc:
from loguru import logger

logger.warning("mmcv is not available, using a fallback implementation")
import torch
import torch.nn as nn
import torch.nn.functional as F

# Fallback: constant_init function
def constant_init(module, val=0, bias=0):
"""Initialize module parameters with constant values."""
if hasattr(module, "weight") and module.weight is not None:
nn.init.constant_(module.weight, val)
if hasattr(module, "bias") and module.bias is not None:
nn.init.constant_(module.bias, bias)
logger.warning(f"mmcv.ops is not available, using a fallback implementation: {exc}")

def _pair(v):
if isinstance(v, tuple):
Expand Down
3 changes: 2 additions & 1 deletion src/demark_world/models/model/modules/flow_comp.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import ConvModule
from mmcv.runner import load_checkpoint
from mmengine.runner import load_checkpoint

from demark_world.configs import SPYNET_CHECKPOINT_PATH, PHY_NET_CHECKPOINT_REMOTE_URL
from demark_world.utils.download_utils import ensure_model_downloaded

Expand Down
Loading