Closed LemurPwned closed 3 weeks ago
This pull request simplifies imports and makes minor adjustments to improve code organization and type hinting. The changes focus on conditional imports, error handling, and type annotations.
classDiagram
class KeywordCapture {
+contextlib
+collections
+collections.abc
+requests
+requests.exceptions
+pysrt
+spacy
+Color
+console
}
class Gating {
+_embed_frames(frames: list[Image.Image])
+_get_margins(frame_embeds: "torch.Tensor")
}
KeywordCapture --> Gating : uses
KeywordCapture : +subtitle_line
Gating : +_embed_frames
Gating : +_get_margins
Change | Details | Files |
---|---|---|
Implement conditional imports for optional dependencies |
|
video_sampler/language/keyword_capture.py |
Improve type hinting |
|
video_sampler/gating.py |
Summary by Sourcery
Simplify import statements by using contextlib to handle optional dependencies and update type hinting for a method parameter.
Enhancements: