All Projects → maxhumber → Gif

maxhumber / Gif

Licence: mit
✨ The extension for Altair, matplotlib, and Plotly animations

Projects that are alternatives of or similar to Gif

Triplet recommendations keras
An example of doing MovieLens recommendations using triplet loss in Keras
Stars: ✭ 400 (-1.48%)
Mutual labels:  jupyter-notebook
Joint Vae
Pytorch implementation of JointVAE, a framework for disentangling continuous and discrete factors of variation 🌟
Stars: ✭ 404 (-0.49%)
Mutual labels:  jupyter-notebook
Eco Efficient Video Understanding
Code and models of paper " ECO: Efficient Convolutional Network for Online Video Understanding", ECCV 2018
Stars: ✭ 406 (+0%)
Mutual labels:  jupyter-notebook
Tensorflow 101
《TensorFlow 快速入门与实战》和《TensorFlow 2 项目进阶实战》课程代码与课件
Stars: ✭ 402 (-0.99%)
Mutual labels:  jupyter-notebook
Oreilly Learning Tensorflow
Stars: ✭ 404 (-0.49%)
Mutual labels:  jupyter-notebook
Skimage Tutorials
skimage-tutorials: a collection of tutorials for the scikit-image package.
Stars: ✭ 403 (-0.74%)
Mutual labels:  jupyter-notebook
Vcdb
VERIS Community Database
Stars: ✭ 398 (-1.97%)
Mutual labels:  jupyter-notebook
Kaggle
Codes for Kaggle Competitions
Stars: ✭ 404 (-0.49%)
Mutual labels:  jupyter-notebook
Coursera Stanford Ml Python
Coursera/Stanford Machine Learning course assignments in python
Stars: ✭ 403 (-0.74%)
Mutual labels:  jupyter-notebook
Faster rcnn for open images dataset keras
Faster R-CNN for Open Images Dataset by Keras
Stars: ✭ 405 (-0.25%)
Mutual labels:  jupyter-notebook
Deepsvg
[NeurIPS 2020] Official code for the paper "DeepSVG: A Hierarchical Generative Network for Vector Graphics Animation". Includes a PyTorch library for deep learning with SVG data.
Stars: ✭ 403 (-0.74%)
Mutual labels:  jupyter-notebook
Tensorflow learning notes
tensorflow学习笔记,来源于电子书:《Tensorflow实战Google深度学习框架》
Stars: ✭ 403 (-0.74%)
Mutual labels:  jupyter-notebook
Ml Powered Applications
Companion repository for the book Building Machine Learning Powered Applications
Stars: ✭ 402 (-0.99%)
Mutual labels:  jupyter-notebook
Anlp19
Course repo for Applied Natural Language Processing (Spring 2019)
Stars: ✭ 402 (-0.99%)
Mutual labels:  jupyter-notebook
Simgan Captcha
Solve captcha without manually labeling a training set
Stars: ✭ 405 (-0.25%)
Mutual labels:  jupyter-notebook
Trainyourownyolo
Train a state-of-the-art yolov3 object detector from scratch!
Stars: ✭ 399 (-1.72%)
Mutual labels:  jupyter-notebook
Mit ocw linear algebra 18 06
IPython notebooks on Gilbert Strang's MIT course on linear algebra (18.06)
Stars: ✭ 403 (-0.74%)
Mutual labels:  jupyter-notebook
H2o Meetups
Presentations from H2O meetups & conferences by the H2O.ai team
Stars: ✭ 405 (-0.25%)
Mutual labels:  jupyter-notebook
Pycon 2016 Tutorial
Machine Learning with Text in scikit-learn
Stars: ✭ 405 (-0.25%)
Mutual labels:  jupyter-notebook
The Elements Of Statistical Learning Python Notebooks
A series of Python Jupyter notebooks that help you better understand "The Elements of Statistical Learning" book
Stars: ✭ 405 (-0.25%)
Mutual labels:  jupyter-notebook

gif

GitHub Travis PyPI Downloads

About

The extension for Altair, matplotlib, and Plotly animations.

Installation

gif is installed at the command line:

pip install -U gif

Depending on which flavour of gif you plan to use you'll likely need some additional dependencies:

pip install "gif[altair]"     
pip install "gif[matplotlib]"
pip install "gif[plotly]"

Note: gif[altair] uses Selenium, which requires a properly configured chromedriver or geckodriver.

Usage (Altair)

Imports and data:

import random
import altair as alt
import pandas as pd
import gif

df = pd.DataFrame({
    't': list(range(10)) * 10,
    'x': [random.randint(0, 100) for _ in range(100)],
    'y': [random.randint(0, 100) for _ in range(100)]
})

Decorate a plot function with gif.frame and return an Altair object:

@gif.frame
def plot(i):
    d = df[df['t'] == i]
    chart = alt.Chart(d).encode(
        x=alt.X('x', scale=alt.Scale(domain=(0, 100))),
        y=alt.Y('y', scale=alt.Scale(domain=(0, 100)))
    ).mark_circle()
    return chart

Build a bunch of "frames" with a standard for loop:

frames = []
for i in range(10):
    frame = plot(i)
    frames.append(frame)

Specify the duration between each frame and save:

gif.save(frames, 'example.gif', duration=100, unit="ms", between="frames")

Usage (matplotlib)

Imports and data:

import random
from matplotlib import pyplot as plt
import gif

x = [random.randint(0, 100) for _ in range(100)]
y = [random.randint(0, 100) for _ in range(100)]

(Optional) Set the dots per inch resolution to 300:

gif.options.matplotlib["dpi"] = 300

Decorate a plot function with gif.frame (and don't return anything):

@gif.frame
def plot(i):
    xi = x[i*10:(i+1)*10]
    yi = y[i*10:(i+1)*10]
    plt.scatter(xi, yi)
    plt.xlim((0, 100))
    plt.ylim((0, 100))

Build a bunch of "frames" with a standard for loop:

frames = []
for i in range(10):
    frame = plot(i)
    frames.append(frame)

Specify the duration of the entire gif:

gif.save(frames, 'example.gif', duration=3.5, unit="s", between="startend")

Usage (Plotly)

Imports and data:

import random
import plotly.graph_objects as go
import pandas as pd
import gif

df = pd.DataFrame({
    't': list(range(10)) * 10,
    'x': [random.randint(0, 100) for _ in range(100)],
    'y': [random.randint(0, 100) for _ in range(100)]
})

Decorate a plot function with gif.frame and return a Plotly figure:

@gif.frame
def plot(i):
    d = df[df['t'] == i]
    fig = go.Figure()
    fig.add_trace(go.Scatter(
        x=d["x"],
        y=d["y"],
        mode="markers"
    ))
    fig.update_layout(width=500, height=300)
    return fig

Build a bunch of "frames" with a standard for loop:

frames = []
for i in range(10):
    frame = plot(i)
    frames.append(frame)

Specify the duration (milliseconds) between each frame and save:

gif.save(frames, 'example.gif', duration=100)

Gallery (Altair)

Click on any image to see the source code

covid.gif emoji.gif pyramid.gif
textbooks.gif wave.gif

Gallery (matplotlib)

Click on any image to see the source code

attachment.gif hop.gif phone.gif
seinfeld.gif attachment.gif love.gif
subplots.gif compare_2_features.gif train_test_split.gif

Gallery (Plotly)

Click on any image to see the source code

bubble.gif swirl.gif waterfall.gif

If you have a dope ass animation that you think should be in the Gallery, submit a PR!

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].