Fix/video classification pipeline video processor#46256
Conversation
…eline VideoClassificationPipeline previously hardcoded _load_image_processor=True, causing an OSError when loading models that only have a video processor (e.g. facebook/vjepa2-vitl-fpc64-256). - Add _load_video_processor flag support to pipeline base classes - Add _resolve_video_processor helper in pipelines/__init__.py - Update VideoClassificationPipeline to load both processors optionally, preferring video_processor when available, falling back to image_processor for legacy models (VideoMAE, ViViT, TimeSformer) Fixes huggingface#41950
zucchini-nlp
left a comment
There was a problem hiding this comment.
Great job, thanks a lot!
Left a few comments to deprecate out image processor, and use video processor to its full capacity
Sure I'll fix them up and update the PR. |
|
@zucchini-nlp I have updated the PR with the latest changes as part of the comments left. |
PR is updated with related to the comments |
zucchini-nlp
left a comment
There was a problem hiding this comment.
Took some liberty to address the last comment which was not addressed, will merge after testing
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
|
[For maintainers] Suggested jobs to run (before merge) run-slow: auto, timesformer, vivit |
Fixes the video classification pipeline that fails for models with only a video processor. This is achieved by adding VideoProcessor classes to the two remaining video classification models that did not have one.
There are four models in MODEL_FOR_VIDEO_CLASSIFICATION_MAPPING_NAMES. Vjepa2 and Videomae already had video processors listed in VIDEO_PROCESSOR_MAPPING_NAMES.
This PR adds the two missing ones:
Both are registered in VIDEO_PROCESSOR_MAPPING_NAMES and exported from their respective init.py files.
Fixes #41950
Before submitting
Pull Request section? YES
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
@zucchini-nlp