Skip to content

Commit

Permalink
Import & data loading fixes for IC & multilabel notebooks (#2410)
Browse files Browse the repository at this point in the history
  • Loading branch information
Advitya17 authored Nov 10, 2023
1 parent 002b1a0 commit 0312072
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
"from zipfile import ZipFile\n",
"import numpy as np\n",
"import pandas as pd\n",
"import datasets\n",
"import matplotlib\n",
"matplotlib.use('Agg')\n",
"import matplotlib.pyplot as plt\n",
Expand Down Expand Up @@ -91,12 +90,18 @@
" # get all file names into a pandas dataframe with the labels\n",
" data = pd.DataFrame(columns=[ImageColumns.IMAGE.value,\n",
" ImageColumns.LABEL.value])\n",
" \n",
" feats = []\n",
" for folder in os.listdir(\"./data/fridgeObjects\"):\n",
" for file in os.listdir(\"./data/fridgeObjects/\" + folder):\n",
" image_path = \"./data/fridgeObjects/\" + folder + \"/\" + file\n",
" data = data.append({ImageColumns.IMAGE.value: image_path,\n",
" ImageColumns.LABEL.value: folder},\n",
" ignore_index=True)\n",
" feats.append({ImageColumns.IMAGE.value: image_path,\n",
" ImageColumns.LABEL.value: folder})\n",
" \n",
" # get all file names into a pandas dataframe with the labels\n",
" data = pd.DataFrame(feats, columns=[ImageColumns.IMAGE.value,\n",
" ImageColumns.LABEL.value])\n",
"\n",
" return data\n",
"\n",
"\n",
Expand Down Expand Up @@ -263,7 +268,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.16"
"version": "3.9.18"
},
"orig_nbformat": 4,
"vscode": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
"from zipfile import ZipFile\n",
"import numpy as np\n",
"import pandas as pd\n",
"import datasets\n",
"import matplotlib\n",
"matplotlib.use('Agg')\n",
"import matplotlib.pyplot as plt\n",
Expand Down Expand Up @@ -397,7 +396,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.16"
"version": "3.9.18"
},
"orig_nbformat": 4,
"vscode": {
Expand Down

0 comments on commit 0312072

Please sign in to comment.