Skip to content

Instantly share code, notes, and snippets.

View nam157's full-sized avatar
🏠
Working from home

Nguyễn Hoài Nam nam157

🏠
Working from home
View GitHub Profile
import os
import torch
import torch.utils.data
import torchvision
from PIL import Image
from pycocotools.coco import COCO
class myOwnDataset(torch.utils.data.Dataset):
def __init__(self, root, annotation, transforms=None):
self.root = root
@jdye64
jdye64 / gist:ca07e01ff3d8e93210c3
Created June 23, 2015 03:59
Convert .dav files in current directory to .mp4
#!/usr/bin/python
print "Converting all of the .dav files in this current directory into .mp4 files using ffmpeg"
import os
from subprocess import call
files = [f for f in os.listdir('.') if os.path.isfile(f)]
for f in files:
ext = f.split(".")[-1]
if ext == "dav" or ext == "DAV":
@alotaiba
alotaiba / google_text2speech.md
Created February 3, 2012 07:31
Google Text to Speech API

Google Text to Speech API

Base URL: http://translate.google.com/translate_tts
It converts written words into audio. It accepts GET requests.

GET

q
The query string to convert to audio

tl
Translation language, for example, ar for Arabic, or en-us for English