のねのBlog

パソコンの問題や、ソフトウェアの開発で起きた問題など書いていきます。よろしくお願いします^^。

2019-02-20から1日間の記事一覧

python 正規表現

pat= r'/([^/]+)_\d+.jpg$' data = ImageDataBunch.from_name_re( path_img, fnames, pat, ds_tfms=get_transforms(), size=224, bs=bs ).normalize(imagenet_stats) qiita.com:embed:cite]https://www.debuggex.com/?re=&str=

ifnoneは、coreの関数

def ifnone(a:Any,b:Any)->Any: "`a` if `a` is not None, otherwise `b`." return b if a is None else a https://github.com/fastai/fastai/blob/master/fastai/core.py 「aがNoneでなければa、そうでなければbです。」 def test_ifnone(): assert ifnone(…

untar_data

def untar_data( url:str, fname:PathOrStr=None, dest:PathOrStr=None, data=True, force_download=False) -> Path: "Download `url` to `fname` if it doesn't exist, and un-tgz to folder `dest`." dest = url2path(url, data) if dest is None else Pat…