Skip to content

Commit fb8261a

Browse files
authored
Revert "Skip internvideo2 Test if not installed (#1089)" (#1110)
This reverts commit b852ef7.
1 parent 2ba14e7 commit fb8261a

File tree

5 files changed

+13
-74
lines changed

5 files changed

+13
-74
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,3 @@ data/
152152

153153
# Text Editor / IDE Files
154154
.vscode
155-
156-
# InternVideo2 dependency (cloned by installation script)
157-
InternVideo/

external/intern_video2_installation.sh

Lines changed: 0 additions & 37 deletions
This file was deleted.

tests/models/test_internvideo2.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,12 @@
1818
from unittest.mock import MagicMock, Mock, patch
1919

2020
import numpy as np
21-
import pytest
2221
import torch
2322

24-
try:
25-
from nemo_curator.stages.video.embedding.internvideo2 import (
26-
InternVideo2EmbeddingStage,
27-
InternVideo2FrameCreationStage,
28-
)
29-
except ImportError:
30-
pytest.skip("InternVideo2 package not available", allow_module_level=True)
31-
23+
from nemo_curator.stages.video.embedding.internvideo2 import (
24+
InternVideo2EmbeddingStage,
25+
InternVideo2FrameCreationStage,
26+
)
3227
from nemo_curator.tasks.video import Clip, Video, VideoTask
3328

3429
# Create a random generator for consistent testing

tests/models/test_internvideo2_mm.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,14 @@
2121
import torch
2222
from easydict import EasyDict
2323

24-
try:
25-
from nemo_curator.models.internvideo2_mm import (
26-
BERT_MODEL_ID,
27-
INTERNVIDEO2_MODEL_FILE,
28-
INTERNVIDEO2_MODEL_ID,
29-
InternVideo2MultiModality,
30-
_InternVideo2Stage2Wrapper,
31-
_setup_internvideo2,
32-
)
33-
except ImportError:
34-
pytest.skip("InternVideo2 package not available", allow_module_level=True)
24+
from nemo_curator.models.internvideo2_mm import (
25+
BERT_MODEL_ID,
26+
INTERNVIDEO2_MODEL_FILE,
27+
INTERNVIDEO2_MODEL_ID,
28+
InternVideo2MultiModality,
29+
_InternVideo2Stage2Wrapper,
30+
_setup_internvideo2,
31+
)
3532

3633
# Create a random generator for consistent testing
3734
rng = np.random.default_rng(42)

tutorials/video/getting-started/video_split_clip_example.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,7 @@
2727
CosmosEmbed1EmbeddingStage,
2828
CosmosEmbed1FrameCreationStage,
2929
)
30-
31-
try:
32-
from nemo_curator.stages.video.embedding.internvideo2 import (
33-
InternVideo2EmbeddingStage,
34-
InternVideo2FrameCreationStage,
35-
)
36-
except ImportError:
37-
print("InternVideo2 is not installed")
38-
InternVideo2EmbeddingStage = None
39-
InternVideo2FrameCreationStage = None
40-
30+
from nemo_curator.stages.video.embedding.internvideo2 import InternVideo2EmbeddingStage, InternVideo2FrameCreationStage
4131
from nemo_curator.stages.video.filtering.clip_aesthetic_filter import ClipAestheticFilterStage
4232
from nemo_curator.stages.video.filtering.motion_filter import MotionFilterStage, MotionVectorDecodeStage
4333
from nemo_curator.stages.video.io.clip_writer import ClipWriterStage
@@ -169,9 +159,6 @@ def create_video_splitting_pipeline(args: argparse.Namespace) -> Pipeline: # no
169159
)
170160
)
171161
elif args.embedding_algorithm.startswith("internvideo2"):
172-
if InternVideo2FrameCreationStage is None:
173-
msg = "InternVideo2 is not installed, please consider installing it or using cosmos-embed1 instead."
174-
raise ValueError(msg)
175162
pipeline.add_stage(
176163
InternVideo2FrameCreationStage(
177164
model_dir=args.model_dir,

0 commit comments

Comments
 (0)