All Projects → google → Mediapy

google / Mediapy

Licence: apache-2.0
This Python library makes it easy to display images and videos in a notebook.

Projects that are alternatives of or similar to Mediapy

React Viewer
react image viewer, supports rotation, scale, zoom and so on
Stars: ✭ 502 (+292.19%)
Mutual labels:  image, viewer
Py Style Transfer
🎨 Artistic neural style transfer with tweaks (pytorch).
Stars: ✭ 23 (-82.03%)
Mutual labels:  jupyter-notebook, image
Viewerjs
JavaScript image viewer.
Stars: ✭ 6,270 (+4798.44%)
Mutual labels:  image, viewer
Goiv
Small and simple image viewer written in pure Go.
Stars: ✭ 182 (+42.19%)
Mutual labels:  image, viewer
V Viewer
Image viewer component for vue, supports rotation, scale, zoom and so on, based on viewer.js
Stars: ✭ 1,776 (+1287.5%)
Mutual labels:  image, viewer
Simpleimageviewer
A snappy image viewer with zoom and interactive dismissal transition.
Stars: ✭ 408 (+218.75%)
Mutual labels:  image, viewer
Exhibit
Exhibit is a managed screensaver App for tvOS.
Stars: ✭ 19 (-85.16%)
Mutual labels:  image, viewer
Quick Picture Viewer
🖼️ Lightweight, versatile desktop image viewer for Windows. The best replacement for the default Windows photo viewer.
Stars: ✭ 237 (+85.16%)
Mutual labels:  image, viewer
Imgviewer
jQuery plugin to zoom and pan images, even those with a size that is a percentage of their container
Stars: ✭ 50 (-60.94%)
Mutual labels:  image, viewer
Imageretrieval
Stars: ✭ 28 (-78.12%)
Mutual labels:  jupyter-notebook, image
Qt5 Imageviewer
Simple image viewer in Qt5
Stars: ✭ 5 (-96.09%)
Mutual labels:  image, viewer
Imageviewer
A simple and customizable Android full-screen image viewer 一个简单且可自定义的Android全屏图像浏览器
Stars: ✭ 1,889 (+1375.78%)
Mutual labels:  image, viewer
Jukeboks
Jukeboks is a fast viewer / player app
Stars: ✭ 21 (-83.59%)
Mutual labels:  image, viewer
Stfalconimageviewer
A simple and customizable Android full-screen image viewer with shared image transition support, "pinch to zoom" and "swipe to dismiss" gestures
Stars: ✭ 1,734 (+1254.69%)
Mutual labels:  image, viewer
Xlimageviewer
iOS 仿照今日头条的图片浏览工具。
Stars: ✭ 161 (+25.78%)
Mutual labels:  image, viewer
Dst
Deformable Style Transfer (ECCV 2020)
Stars: ✭ 167 (+30.47%)
Mutual labels:  jupyter-notebook
Rnn For Human Activity Recognition Using 2d Pose Input
Activity Recognition from 2D pose using an LSTM RNN
Stars: ✭ 165 (+28.91%)
Mutual labels:  jupyter-notebook
Lisrd
Local Invariance Selection at Runtime for Descriptors (LISRD)
Stars: ✭ 166 (+29.69%)
Mutual labels:  jupyter-notebook
Hacking Civico
Curso de Datos Abiertos y Hacking Cívico, habilitando las capacidades de la ciudadanía y los servidores públicos en el uso de datos abiertos.
Stars: ✭ 167 (+30.47%)
Mutual labels:  jupyter-notebook
Stuff
Stuff I uploaded to share online or to access from a different machine
Stars: ✭ 167 (+30.47%)
Mutual labels:  jupyter-notebook

Read/write/show images and videos in an IPython/Jupyter notebook.

[GitHub source]   [API docs]   [PyPI package]

Examples:

See the notebook   mediapy_examples.ipynb     Open In Colab   Open in Binder

Images:

    !pip install -q mediapy
    import mediapy as media
    import numpy as np

    image = media.read_image('https://github.com/hhoppe/data/raw/main/image.png')
    print(image.shape, image.dtype)  # It is a numpy array.
    media.show_image(image)

    checkerboard = np.kron([[0, 1] * 16, [1, 0] * 16] * 16, np.ones((4, 4)))
    media.show_image(checkerboard)

    media.show_image(media.color_ramp((128, 128)), height=48, title='ramp')

    images = {
        'original': image,
        'brightened': media.to_float01(image) * 1.5,
    }
    media.show_images(images)

    media.write_image('/tmp/checkerboard.png', checkerboard)

Videos:

    video = media.read_video('https://github.com/hhoppe/data/raw/main/video.mp4')
    print(video.shape, video.dtype)  # It is a numpy array.
    media.show_video(video)

    media.show_images(video, height=80, columns=4)  # Frames side-by-side.

    video2 = media.moving_circle((128, 128), num_images=10)
    media.show_video(video2)

    media.write_video('/tmp/video.mp4', video)

    # Darken a video frame-by-frame:
    filename_in = '/tmp/video.mp4'
    filename_out = '/tmp/out.mp4'
    with media.VideoReader(filename_in) as r:
      print(f'shape={r.shape} fps={r.fps} bps={r.bps}')
      darken_image = lambda image: media.to_float01(image) * 0.5
      with media.VideoWriter(
          filename_out, shape=r.shape, fps=r.fps, bps=r.bps) as w:
        for image in r:
          w.add_image(darken_image(image))
    media.show_video(media.read_video(filename_out))

Setup:

Video I/O relies on the external program ffmpeg, which must be present in the system PATH. On Unix, it can be installed using:

    apt-get install ffmpeg

or within a notebook using:

    !command -v ffmpeg >/dev/null || (apt update && apt install -y ffmpeg)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].