This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "", | |
"signature": "sha256:0feedd0a35b31c9754c41d8a4b1cc4d08d77967657305f0b8f43b24c397cd132" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import blosc | |
data = [ | |
0x93, 0xb0, 0x49, 0xaf, 0x62, 0xad, 0xe3, 0xaa, 0xe4, 0xa5, 0x43, 0x20, | |
0x24, 0x29, 0xc9, 0xaf, 0xee, 0xad, 0x0b, 0xac, 0x3d, 0xa8, 0x1f, 0x99, | |
0x53, 0x27, 0xb6, 0x2b, 0x16, 0xb0, 0x5f, 0xae, 0x89, 0xac, 0x51, 0xa9, | |
0xfc, 0xa1, 0xc9, 0x24, 0x59, 0x2a, 0x2f, 0x2d, 0xb4, 0xae, 0xeb, 0xac, | |
0x2f, 0xaa, 0xec, 0xa4, 0x53, 0x21, 0x31, 0x29, 0x8f, 0x2c, 0x8e, 0x2e, | |
0x31, 0xad, 0xd6, 0xaa, 0x6d, 0xa6, 0xad, 0x1b, 0x3e, 0x28, 0x0a, 0x2c, | |
0xfd, 0x2d, 0xf8, 0x2f, 0x45, 0xab, 0x81, 0xa7, 0x1f, 0x95, 0x02, 0x27, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zsh» git init example | |
Initialized empty Git repository in /tmp/example/.git/ | |
zsh» cd example | |
zsh» cp ../objektmodell-beispiel/hello.py . | |
zsh» cat hello.py | |
#! /usr/bin/env python | |
""" Hello World! """ | |
print 'Hello World!' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
import moto | |
@moto.mock_ec2 | |
def expose(): | |
ec2 = boto3.resource('ec2') | |
blue, green = ec2.create_instances( | |
ImageId='ANY_ID', MinCount=2, MaxCount=2) | |
ec2.create_tags(Resources=[blue.instance_id], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import the main interface for reading | |
from gulpio import GulpDirectory | |
# instantiate the GulpDirectory | |
gulp_directory = GulpDirectory('/tmp/something_something_gulps') | |
# iterate over all chunks | |
for chunk in gulp_directory: | |
# for each 'video' get the metadata and all frames | |
for frames, meta in chunk: | |
# do something with the metadata | |
for i, f in enumerate(frames): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from gulpio.dataset import GulpImageDataset | |
from gulpio.loader import DataLoader | |
from gulpio.transforms import Scale, CenterCrop, Compose, UnitNorm | |
# define data augmentations. Notice that there are different functions for videos and images | |
transforms = Compose([ | |
Scale(28), # resize image by the shortest edge | |
CenterCrop(28), | |
UnitNorm(), # instance wise mean and std norm | |
]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AbstractDatasetAdapter(ABC): | |
""" Base class adapter for gulping (video) datasets. | |
Inherit from this class and implement the `iter_data` method. This method | |
should iterate over your entire dataset and for each element return a | |
dictionary with the following fields: | |
id : a unique(?) ID for the element. | |
frames : a list of frames (PIL images, numpy arrays..) | |
meta : a dictionary with arbitrary metadata (labels, start_time...) | |
For examples, see the custom adapters below. | |
""" |