Skip to content

Instantly share code, notes, and snippets.

View nnop's full-sized avatar
🎯
Focusing

nnop

🎯
Focusing
View GitHub Profile
class DataProvider(object):
def __init__(self,label_dict, top_blobs = None):
# for determinist evaluation
self.random_state = None
self.label_dict = label_dict
if top_blobs is None:
x = label_dict.values()[0]
if type(x) == int:
self.top_blobs = ["img", "label"]
@wy193777
wy193777 / s3_download_file_progress_bar.py
Last active July 20, 2023 15:52
Show AWS s3 download_file Progress using tqdm
#python3
def hook(t):
def inner(bytes_amount):
t.update(bytes_amount)
return inner
BUCKET_NAME = 'your_s3_bucket_name'
FILE_NAME = 'your_s3_file_name'
s3 = boto3.resource('s3')
@agelastic
agelastic / styling.css
Created November 20, 2017 01:41
Anki styling for Chinese cards
.card {
font-family: arial;
font-size: 20px;
text-align: center;
color: black;
background-color: white;
}
.card { word-wrap: break-word; }
.win .chinese { font-family: "MS Mincho", "MS 明朝"; }
.mac .chinese { font-family: "STFangsong"}
@djhoese
djhoese / animation_rotate_cube.py
Created September 30, 2020 13:20
Create MP4 animation of rotating cube.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vispy: gallery 50
"""
This example shows how to display 3D objects.
You should see a colored outlined spinning cube.
"""
import numpy as np
from vispy import app, gloo