Skip to content

About

Official implementation of "EchoTracker: Advancing Myocardial Point Tracking in Echocardiography". (MICCAI 2024)

Resources

Stars

66 stars

Watchers

4 watching

Forks

Latest commit

 

History

51 Commits

Folders and files

Repository files navigation

EchoTracker: Advancing Myocardial Point Tracking in Echocardiography

Official code repository  ·  Accepted at MICCAI 2024 (top 11%)

If you find this work useful, please consider giving the repository a ⭐ — it helps others discover the project and motivates further development!

Paper   arXiv   Project Page   HF Demo   License


Updates

  • (13.04.26) A web-based demo is now live on Hugging Face Spaces — try EchoTracker instantly in your browser with no local setup: 🤗 HF Demo.
  • (13.04.26) demo2 is redesigned as a fully interactive single-window GUI — play the video, click to select points, run tracking, and view EchoTracker vs TAPIR results side-by-side, all without leaving the window.
  • (19.11.24) Fine-tuning and inference code for TAPIR added. Licensing updated accordingly.
  • (19.11.24) The interactive demo (demo2) now visualizes tracking results from both EchoTracker and TAPIR together.

Table of Contents


Installation

# 1. Clone the repository
git clone https://github.com/riponazad/echotracker.git
cd echotracker

# 2. Create and activate a conda environment
conda create --name echotracker python=3.11
conda activate echotracker

# 3. Install dependencies
pip install -r requirements.txt

# 4. Add the project root to PYTHONPATH
export PYTHONPATH=`(cd ../ && pwd)`:`pwd`:$PYTHONPATH

Model Checkpoints

Download each checkpoint and place the file in the corresponding directory before running any demo.

Model Checkpoint Destination
EchoTracker model-000000000.pth model/weights/echotracker/
TAPIR (fine-tuned) model-000000099.pth model/weights/tapir/finetuned/

Note on the Hugging Face Demo weights: The EchoTracker model served in the 🤗 HF Demo uses an updated checkpoint from a follow-up work: Taming Modern Point Tracking for Speckle Tracking Echocardiography via Impartial Motion — ICCV 2025 Workshop  ·  [arXiv]

This version achieves best performance when query points are selected from the frame located at approximately 72% of the video's time dimension — corresponding to diastasis (the quiescent slow-filling phase between the E-wave and A-wave) in a full ED-to-ED cardiac cycle (e.g. frame 72 of a 100-frame sequence). If you use this model, please also cite that paper — see the Citation section.

Explicit noncommercial notice: the trained weights for every model above that was trained or fine-tuned on our ultrasound data — the EchoTracker checkpoint and the fine-tuned TAPIR checkpoint alike — are released under the same CC BY-NC 4.0 license as the EchoTracker code, for noncommercial use only, regardless of whether the underlying architecture originates elsewhere. Commercial use requires a separate agreement; see License for how to contact NTNU TTO. If you use other pretrained models alongside this project (e.g., a base TAPIR checkpoint from its original source), check that model's own licensing terms separately.


Run Demos

Demo 1 — Quantitative evaluation

python demo1.py

Loads EchoTracker and the bundled ultrasound sample data, estimates trajectories for the preset query points, and prints performance metrics.


Demo 2 — Interactive single-window GUI

python demo2.py <video_name>

<video_name> is the filename without the .mp4 extension. The script looks for the video in the data/ folder, so the full path resolved is data/<video_name>.mp4. To use your own video, copy it into the data/ folder first and pass its name accordingly.

Example: python demo2.py input → loads data/input.mp4

Everything happens inside one matplotlib window — no separate video players or pop-up figures.

Step Action
1. Watch The video plays automatically once models are loaded.
2. Pause Click "Pause & Select Points" to freeze on the first frame.
3. Select Left-click anywhere on the frame to place tracking points (up to 40).
4. Clear Click "Clear Points" to remove all placed points and start over.
5. Track Click "Run Tracking" — both EchoTracker and TAPIR run in the background.
6. Review Results appear side-by-side with preserved aspect ratio (EchoTracker left, TAPIR right). The combined video is saved to results/output.mp4.
7. Repeat Click "Pause & Select Points" again at any time to try a different set of points.

No local setup? Try the model directly in your browser via the 🤗 Hugging Face Demo.


Train/Evaluation

The training datasets are not publicly available. The code below shows how to plug in your own data.

EchoTracker

Training and inference are exposed as simple class methods in model/net.py.

from model.net import EchoTracker

B = 1   # batch size
S = 24  # sequence length

# Provide your own data loader
dataloaders, dataset_size = load_datasets(B=B, S=S, use_aug=True)

model = EchoTracker(device_ids=[0])
# model.load(path="model/weights/echotracker", eval=False)  # uncomment to fine-tune
model.load(eval=False)
model.train(
    dataloaders=dataloaders,
    dataset_size=dataset_size,
    log_dir="logs/echotracker",
    ckpt_path="model/weights/echotracker",
    epochs=100,
)

TAPIR (fine-tuning)

from model.net import TAPIR

B = 1   # batch size
S = 24  # sequence length

# Provide your own data loader
dataloaders, dataset_size = load_datasets(B=B, S=S, use_aug=True)

model = TAPIR(pyramid_level=0)
# model.load(path="model/weights/tapir/finetuned", eval=False)  # uncomment to continue fine-tuning
model.load(eval=False)
model.finetune(
    dataloaders=dataloaders,
    dataset_size=dataset_size,
    log_dir="logs/tapir",
    ckpt_path="model/weights/tapir/finetuned",
    epochs=100,
)

Citation

If you use this code or the EchoTracker model (MICCAI 2024), please cite:

@InProceedings{azad2024echo,
  author    = {Azad, Md Abulkalam and Chernyshov, Artem and Nyberg, John
               and Tveten, Ingrid and Lovstakken, Lasse and Dalen, H{\aa}vard
               and Grenne, Bj{\o}rnar and {\O}stvik, Andreas},
  title     = {EchoTracker: Advancing Myocardial Point Tracking in Echocardiography},
  booktitle = {Medical Image Computing and Computer Assisted Intervention -- MICCAI 2024},
  year      = {2024},
  volume    = {IV},
  publisher = {Springer Nature Switzerland},
  pages     = {645--655},
}

If you use the updated model weights available in the 🤗 Hugging Face Demo, please additionally cite:

@InProceedings{Azad_2025_ICCV,
  author    = {Azad, Md Abulkalam and Nyberg, John and Dalen, H{\aa}vard
               and Grenne, Bj{\o}rnar and Lovstakken, Lasse and {\O}stvik, Andreas},
  title     = {Taming Modern Point Tracking for Speckle Tracking Echocardiography via Impartial Motion},
  booktitle = {Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV) Workshops},
  month     = {October},
  year      = {2025},
  pages     = {1115--1124},
}

License

This project uses a dual-license structure due to third-party code inclusion.

Component License
EchoTracker (original code) CC BY-NC 4.0
All model weights/checkpoints trained on our ultrasound data (EchoTracker checkpoint, fine-tuned TAPIR checkpoint) CC BY-NC 4.0
TAPIR integration code (source) Apache License 2.0

Explicit noncommercial notice: EchoTracker's original code, and the trained weights of every model in this repository that was trained or fine-tuned on our ultrasound data, are free to use for noncommercial purposes only (e.g., academic research, education, personal projects), with attribution. This applies without exception to all checkpoints released from this repository — the EchoTracker checkpoint and the fine-tuned TAPIR checkpoint alike, see Model Checkpoints — regardless of whether a given model's underlying architecture originates from a third party. Commercial use is not permitted under this license. If you wish to use EchoTracker's code or any of these model weights for commercial purposes, you must obtain a separate commercial license agreement. Commercial licensing is handled by NTNU Technology Transfer AS (NTNU TTO) — you can reach out to them directly, or contact md.a.azad@ntnu.no or andreas.ostvik@ntnu.no, who will coordinate with NTNU TTO.

If you use other, third-party pretrained models alongside this project (e.g., a base TAPIR checkpoint from its original source), check that model's own license terms separately — they are not covered by EchoTracker's license.

When using this project, retain the respective license notices for each component. See the LICENSE file for full terms.

About

Official implementation of "EchoTracker: Advancing Myocardial Point Tracking in Echocardiography". (MICCAI 2024)

Resources

Stars

66 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages