Image sampler
ImageSampler
Bases: BaseSampler
Image sampler -- sample frames from a folder of images
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cfg |
ImageSamplerConfig
|
Image sampler config |
required |
Methods:
Name | Description |
---|---|
sample |
str) -> Iterable[list[FrameObject]]: Sample frames from image folder |
write_queue |
str, q: Queue, _: str = None): Write frames to queue |
Source code in video_sampler/samplers/image_sampler.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
|
extract_frame_time(image_path, default=None)
Extract frame time from image path Args: image_path (str): Path to image default (str | None): Default frame time to return if no regex is set
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
Frame time |
Source code in video_sampler/samplers/image_sampler.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
|
sample(image_folder)
Sample frames from image folder Args: image_folder (str): Path to image folder or glob pattern
Returns:
Type | Description |
---|---|
Iterable[list[FrameObject]]
|
Iterable[list[FrameObject]]: Iterable of frames |
Source code in video_sampler/samplers/image_sampler.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
write_queue(image_path, q, _=None)
Write frames to queue. Args: image_path (str): Path to image q (Queue): Queue to write frames to
Source code in video_sampler/samplers/image_sampler.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
|