Mydia

Latest version: v2.2.1

Safety actively analyzes 621498 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

2.2.1

Minor release with internal updates

- Nothing new.
- Primarily all the commits and updates to the package after v2.2.0 are attributed to code refactoring, documentation fixes and automation of tests and builds on Travis-ci.

2.2.0

Major features and Improvements
- Support for multiprocessing: Using multiple workers for reading the videos. Resolves 10
- This is demonstrated in the following [example](https://mrinaljain17.github.io/mydia/auto_examples/plot_1_getting_started.htmluse-multiple-workers-for-reading-the-videos-in-parallel) in the docs.
- By using multiple workers, the process of reading the videos could be significantly sped-up. The results of some tests conducted internally can be viewed [here](https://github.com/MrinalJain17/mydia/issues/10issuecomment-428791236)
- New function `make_grid()`: Returns a grid of frames (numpy array). This is a replacement for the old `plot()` function. The new approach is faster and more intuitive. See the docs of [`make_grid()`](https://mrinaljain17.github.io/mydia/videos.htmlmydia-make-grid) for more details.

Breaking changes
- `plot()` has been entirely removed, use `make_grid()` instead.

Bug fixes
- The use of `random_state` has been fixed, and it now guarantees reproducibility of results (even if using multiple workers)
- Due to this fix, the *custom frame selectors* will now receive an additional parameter `random_state`.
- If `ffmpeg` produces an error while reading the videos, it will now be displayed via *stdout*.

2.1.1

Minor release

- Support for disabling the progress bar has been added.
- You can now pass `verbose=0` to the function `Videos.read()` and it will disable the progress bar.

*Apart from this, no new feature is added.*

2.1.0

Major features and improvements

- Normalization of videos is implemented. Now, each video is shifted to the range `(0, 1)` by subtracting the minimum and dividing by the difference between the maximum and minimum pixel values. Resolves ( 8 )
- Refactored documentation
- Also, added certain warnings and notes.

Breaking changes

- Some precautions have been taken for supporting custom frame selection
- The number of frames to be selected returned by the custom function is checked against the passed `num_frames` value. If they are not equal, an error is raised (This could prevent situations where the callable returned a different number of frames for different videos)
- In the previous versions, the value of `num_frames` was ignored if a custom callable was passed.

**It is because of this change that the version was bumped from 2.0 to 2.1**

2.0.1

No new features or changes in this release

- This release is attributed mainly to documentation updates and fixes.

In further updates, examples will be added directly to the documentation.

2.0.0

Major Features and Improvements

- Scikit-video has been dropped as the backend for `mydia`. ( 13 )
- [ffmpeg-python](https://github.com/kkroening/ffmpeg-python) will now be used as the backend providing bindings between python and ffmpeg

- Support for **Custom Frame Selection** ( 6 )
- The `mode` can now take a *callable*, that should return the indices of the frames to be selected from the video. For example -

python
from mydia import Videos

def custom(total_frames, num_frames, fps):
Selecting the frames at even indexes
return list(range(0, total_frames, 2))

reader = Videos(target_size=(480, 360), to_gray=False, num_frames=36, mode=custom)

- Detailed explaination and examples will be demonstrated in the documentation

Breaking Changes

- There is no "manual" `mode` for frame selection now. The parameter `required_fps` has been removed as the requirement of such a feature did not seem much useful and was complicating the code unnecessarily.
- With this change, the parameter `extract_position` had no such explicit use, and therefore its functionality has been merged with `mode`. That is -
- `extract_position` has been removed
- `mode` now supports "first", "last" and "middle" along with "auto" and "random"
- These modifications have significantly reduced the complexity of the code base. Also, any such requirement for frame extraction can now be fulfilled by using custom callables to `mode`
- `plot()` is not a part of the class `Videos` anymore
- `Videos` is now exclusively for *reading* the videos, and `plot()` is available as a standalone function in `mydia.py`
- The change inflicted by this is that `plot` will take as argument **only** a video and the option of passing the path of the video has now been removed. Everything else, however, is expected to work in the same way as before.

**Earlier**

python
from mydia import Videos
reader = Videos()
video = reader.read("/path/to/video")
reader.plot(video[0])


**Now**
python
from mydia import Videos, plot
reader = Videos()
video = reader.read("/path/to/video")
plot(video[0])


Bug Fixes and Other Changes

- "random" mode for frame selection would have repeated certain frames due to a bug in the previous releases' logic. (**Fixed**)
- Frame resizing earlier used *ANTIALIAS* filter via [Pillow](https://pillow.readthedocs.io/en/3.1.x/reference/Image.htmlPIL.Image.Image.resize). Now, the default filter of `ffmpeg` - **BICUBIC** - is used for resizing.
- In most situations, it is comparatively faster

*A comparison, between version 1.0 and 2.0 could be released, but initial tests show that the speed of reading videos have increase by as much as 6x*

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.