{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## datasets" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This module has the necessary functions to be able to download several useful datasets that we might be interested in using in our models." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide_input": true }, "outputs": [], "source": [ "from fastai.gen_doc.nbdoc import *\n", "from fastai.datasets import * \n", "from fastai.datasets import Config\n", "from pathlib import Path" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide_input": true }, "outputs": [ { "data": { "text/markdown": [ "
class URLs[source][test]URLs()\n",
"\n",
"No tests found for URLs. To contribute a test please refer to this guide and this discussion.
untar_data[source][test]untar_data(**`url`**:`str`, **`fname`**:`PathOrStr`=***`None`***, **`dest`**:`PathOrStr`=***`None`***, **`data`**=***`True`***, **`force_download`**=***`False`***) → `Path`\n",
"\n",
"download_data[source][test]download_data(**`url`**:`str`, **`fname`**:`PathOrStr`=***`None`***, **`data`**:`bool`=***`True`***, **`ext`**:`str`=***`'.tgz'`***) → `Path`\n",
"\n",
"No tests found for download_data. To contribute a test please refer to this guide and this discussion.
data directory inside the notebook, that data file will be used instead of ~/.fasta/data. Paths are resolved by calling the function [`datapath4file`](/datasets.html#datapath4file) - which checks if data exists locally (`data/`) first, before downloading to `~/.fastai/data` home directory.\n",
"\n",
"Example:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"PosixPath('/home/ubuntu/.fastai/data/planet_sample.tgz')"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"download_data(URLs.PLANET_SAMPLE)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"hide_input": true
},
"outputs": [
{
"data": {
"text/markdown": [
"datapath4file[source][test]datapath4file(**`filename`**, **`ext`**:`str`=***`'.tgz'`***)\n",
"\n",
"No tests found for datapath4file. To contribute a test please refer to this guide and this discussion.
data directory in the same place as the calling notebook/script, that is used as the parent directly, otherwise `~/.fastai/config.yml` is read to see what path to use, which defaults to ~/.fastai/data is used. To override this default, simply modify the value in your `~/.fastai/config.yml`:\n",
"\n",
" data_path: ~/.fastai/data"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"hide_input": true
},
"outputs": [
{
"data": {
"text/markdown": [
"url2path[source][test]url2path(**`url`**, **`data`**=***`True`***, **`ext`**:`str`=***`'.tgz'`***)\n",
"\n",
"No tests found for url2path. To contribute a test please refer to this guide and this discussion.
class Config[source][test]Config()\n",
"\n",
"get_path[source][test]get_path(**`path`**)\n",
"\n",
"No tests found for get_path. To contribute a test please refer to this guide and this discussion.
data_path[source][test]data_path()\n",
"\n",
"No tests found for data_path. To contribute a test please refer to this guide and this discussion.
model_path[source][test]model_path()\n",
"\n",
"No tests found for model_path. To contribute a test please refer to this guide and this discussion.
create[source][test]create(**`fpath`**)\n",
"\n",
"No tests found for create. To contribute a test please refer to this guide and this discussion.
url2name[source][test]url2name(**`url`**)\n",
"\n",
"No tests found for url2name. To contribute a test please refer to this guide and this discussion.
get_key[source][test]get_key(**`key`**)\n",
"\n",
"No tests found for get_key. To contribute a test please refer to this guide and this discussion.
get[source][test]get(**`fpath`**=***`None`***, **`create_missing`**=***`True`***)\n",
"\n",
"