Skip to content

Make this repo installable as pip package#150

Open
hongjiaherng wants to merge 2 commits intov-iashin:masterfrom
hongjiaherng:master
Open

Make this repo installable as pip package#150
hongjiaherng wants to merge 2 commits intov-iashin:masterfrom
hongjiaherng:master

Conversation

@hongjiaherng
Copy link
Copy Markdown

@hongjiaherng hongjiaherng commented Jan 11, 2026

Description

This PR explores making video_features usable as a pip-installable Python package, in addition to the existing script/Conda workflow.

I was able to:

  • build a wheel
  • install it via pip / uv
  • import and use ExtractI3D programmatically in another project

This is an early PR to check whether this direction makes sense before spending time polishing, testing, and documenting. (i vibe-coded it)


What this enables

Install as a package

uv build
uv pip install dist/<wheel-name>.whl
# or
uv pip install git+<repo-url>.git

Use programmatically

from video_features.models.i3d.extract_i3d import ExtractI3D
from video_features.utils.utils import build_cfg_path
from omegaconf import OmegaConf

args = OmegaConf.load(build_cfg_path("i3d"))
args.video_paths = ["./sample/v_GGSY1Qvo990.mp4"]
args.flow_type = "raft"

extractor = ExtractI3D(args)
features = extractor.extract(args.video_paths[0])

Still usable as a CLI

uv run video-features.exe

Notes

  • This is experimental and not extensively tested yet
  • Goal is to validate the direction, not claim stability
  • Happy to clean up, document, or adjust based on feedback

Questions

  • Is making video_features pip-installable aligned with the project goals?
  • Is exposing extractors (e.g. ExtractI3D) as a public API acceptable?

Thanks for taking a look!


…h pyproject.toml

- Restructured codebase into video_features namespace package
- Added pyproject.toml with hatchling build backend
- Moved main.py to video_features/__main__.py for CLI entry point
- Updated all imports to use video_features namespace
- Fixed path resolution for configs and checkpoints using importlib.resources
- Added optional dependencies for CPU/CUDA PyTorch with uv index support
- Updated test utilities to use new package structure and fix PyTorch 2.6 compatibility
- Fixed cross-drive path issues on Windows in sanity_check
- All tests now pass with updated imports and paths
- Initialize Git LFS configuration
- Track large checkpoint files (*.pth in vggish/hub/checkpoints)
- Note: GitHub doesn't allow LFS uploads to public forks, so these files remain in .gitignore
- Files will be automatically downloaded by the package when needed via torch.hub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant