Skip to content

rbarman/colabutils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

Repository files navigation

colabutils

!git clone https://github.com/rbarman/colabutils
!pip install -r colabutils/requirements.txt
  1. Download opencv compatible images from google. This is a simple way to get images for a computer vision project.
from colabutils import google as g
g.download_imgs_from_google('boats',200)
# {'img_count': 200, 'img_dir': 'downloads/boats/', 'keyword': 'boats'}

Recipes

  1. Working with fastai
from colabutils import google as g
from fastai.vision import *

# download images to downloads/bicycle/ and downloads/unicycle/ 
g.download_imgs_from_google('bicycle',100)
g.download_imgs_from_google('unicycle',100)

data = ImageDataBunch.from_folder('downloads',train=".",valid_pct = .2, ds_tfms=get_transforms(), size=224, bs=64).normalize(imagenet_stats)
# now train with data, etc

About

some wrappers to use in google colab

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages