Skip to content
Open
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
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,18 @@ EoMT with DINOv2 is also available on [Hugging Face Transformers](https://huggin

## Installation

If you don't have Conda installed, install Miniconda and restart your shell:
If you don't have Pixi installed, install Pixi following the instructions in https://pixi.prefix.dev/latest/installation/ .

Then install the dependencies:

```bash
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
pixi install
```

Then create the environment, activate it, and install the dependencies:
To activate the environment run:

```bash
conda create -n eomt python==3.13.2
conda activate eomt
python3 -m pip install -r requirements.txt
pixi s
```

[Weights & Biases](https://wandb.ai/) (wandb) is used for experiment logging and visualization. To enable wandb, log in to your account:
Expand Down Expand Up @@ -98,7 +97,7 @@ wget --load-cookies cookies.txt --content-disposition https://www.cityscapes-dat
To train EoMT from scratch, run:

```bash
python3 main.py fit \
pixi run main fit \
-c configs/dinov2/coco/panoptic/eomt_large_640.yaml \
--trainer.devices 4 \
--data.batch_size 4 \
Expand Down Expand Up @@ -129,7 +128,7 @@ To fine-tune a pre-trained EoMT model, add:
To evaluate a pre-trained EoMT model, run:

```bash
python3 main.py validate \
pixi run main validate \
-c configs/dinov2/coco/panoptic/eomt_large_640.yaml \
--model.network.masked_attn_enabled False \
--trainer.devices 4 \
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion models/eomt.py → eomt/models/eomt.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import torch.nn.functional as F
import math

from models.scale_block import ScaleBlock
from eomt.models.scale_block import ScaleBlock


class EoMT(nn.Module):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from torchvision.transforms.v2.functional import pad
import logging

from training.two_stage_warmup_poly_schedule import TwoStageWarmupPolySchedule
from eomt.training.two_stage_warmup_poly_schedule import TwoStageWarmupPolySchedule

bold_green = "\033[1;32m"
reset = "\033[0m"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import torch.nn as nn
import torch.nn.functional as F

from training.mask_classification_loss import MaskClassificationLoss
from training.lightning_module import LightningModule
from eomt.training.mask_classification_loss import MaskClassificationLoss
from eomt.training.lightning_module import LightningModule


class MaskClassificationInstance(LightningModule):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import torch.nn as nn
import torch.nn.functional as F

from training.mask_classification_loss import MaskClassificationLoss
from training.lightning_module import LightningModule
from eomt.training.mask_classification_loss import MaskClassificationLoss
from eomt.training.lightning_module import LightningModule


class MaskClassificationPanoptic(LightningModule):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import torch.nn as nn
import torch.nn.functional as F

from training.mask_classification_loss import MaskClassificationLoss
from training.lightning_module import LightningModule
from eomt.training.mask_classification_loss import MaskClassificationLoss
from eomt.training.lightning_module import LightningModule


class MaskClassificationSemantic(LightningModule):
Expand Down
5,387 changes: 5,387 additions & 0 deletions pixi.lock

Large diffs are not rendered by default.

51 changes: 51 additions & 0 deletions pixi.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
[workspace]
channels = ["https://prefix.dev/conda-forge"]
preview = ["pixi-build"]
platforms = ["linux-64"]
requires-pixi = ">=0.62"

[system-requirements]
linux = "5.4.0"

[feature.cuda.system-requirements]
cuda = "12"

[package]
name = "eomt"
version = "0.0.1"
description = "Your ViT is Secretly an Image Segmentation Model"
authors = ["Smart Robotics <info@smart-robotics.nl>"]

[package.build]
backend = { name = "pixi-build-python", version = "0.4.*" }

[package.host-dependencies]
python_abi = { version = "3.12.*", build = "*_cp312" }
hatchling = "*"

[package.run-dependencies]
timm = ">=1.0.15,<2"
lightning = ">=2.5,<3"
transformers = ">=4.56"
pytorch = ">=2.7,<3"
torchvision = ">=0.22,<1"
torchmetrics = ">=1.7,<2"
scipy = ">=1.15"
matplotlib-base = ">=3.10"
fvcore = ">=0.1.5"
pycocotools = ">=2.0"
gitignore-parser = ">=0.1"
jsonargparse = ">=4.38"
wandb = ">=0.19,<1"

[dependencies]
eomt = { path = "." }

# Dev-environment-only extras: needed to run the inference notebook and
# typed-config tooling. Kept out of [package.run-dependencies] so downstream
# consumers of the conda package don't pull them in transitively.
ipykernel = ">=6.29"
typeshed-client = ">=2.8"

[tasks]
main = "python3 main.py"
27 changes: 27 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "eomt"
version = "0.0.1"
description = "Your ViT is Secretly an Image Segmentation Model"
requires-python = ">=3.12"
dependencies = [
"timm>=1.0.15,<2",
"lightning>=2.5,<3",
"transformers>=4.56",
"torch>=2.7,<3",
"torchvision>=0.22,<1",
"torchmetrics>=1.7,<2",
"scipy>=1.15",
"matplotlib>=3.10",
"fvcore>=0.1.5",
"pycocotools>=2.0",
"gitignore-parser>=0.1",
"jsonargparse[signatures]>=4.38",
"wandb>=0.19",
]

[tool.hatch.build.targets.wheel]
packages = ["eomt"]
14 changes: 0 additions & 14 deletions requirements.txt

This file was deleted.