{ "cells": [ { "cell_type": "markdown", "id": "1b70b34e", "metadata": {}, "source": [ "### Basic library imports" ] }, { "cell_type": "code", "execution_count": 9, "id": "719d15af", "metadata": {}, "outputs": [], "source": [ "import os\n", "import pandas as pd" ] }, { "cell_type": "markdown", "id": "b8911e33", "metadata": {}, "source": [ "### Read Dataset" ] }, { "cell_type": "code", "execution_count": 10, "id": "d3136aac", "metadata": {}, "outputs": [], "source": [ "DATASET_FOLDER = '../dataset/'\n", "train = pd.read_csv(os.path.join(DATASET_FOLDER, 'train.csv'))\n", "test = pd.read_csv(os.path.join(DATASET_FOLDER, 'test.csv'))\n", "sample_test = pd.read_csv(os.path.join(DATASET_FOLDER, 'sample_test.csv'))\n", "sample_test_out = pd.read_csv(os.path.join(DATASET_FOLDER, 'sample_test_out.csv'))" ] }, { "cell_type": "markdown", "id": "60ebd689", "metadata": {}, "source": [ "### Run Sanity check using src/sanity.py" ] }, { "cell_type": "code", "execution_count": 11, "id": "81bb3988", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Parsing successfull for file: ../dataset/sample_test_out.csv\r\n" ] } ], "source": [ "!python sanity.py --test_filename ../dataset/sample_test.csv --output_filename ../dataset/sample_test_out.csv" ] }, { "cell_type": "code", "execution_count": 12, "id": "5aa79459", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Error: Invalid unit [lbs] found in 6.75 lbs. Allowed units: {'watt', 'litre', 'kilogram', 'gallon', 'millilitre', 'microgram', 'millimetre', 'microlitre', 'kilowatt', 'imperial gallon', 'foot', 'kilovolt', 'millivolt', 'quart', 'inch', 'centimetre', 'yard', 'decilitre', 'ton', 'metre', 'pound', 'fluid ounce', 'cup', 'pint', 'volt', 'centilitre', 'ounce', 'gram', 'cubic inch', 'milligram', 'cubic foot'}\r\n" ] } ], "source": [ "!python sanity.py --test_filename ../dataset/sample_test.csv --output_filename ../dataset/sample_test_out_fail.csv" ] }, { "cell_type": "markdown", "id": "dbe930a8", "metadata": {}, "source": [ "### Download images" ] }, { "cell_type": "code", "execution_count": 13, "id": "a3d1aad8", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "#images to download: 54\n", "Download started... using 64 threads\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\u001b[38;2;0;255;0m100%\u001b[39m \u001b[38;2;0;255;0m(54 of 54)\u001b[39m |########################| Elapsed Time: 0:00:00 ETA: 00:00:00\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "... Download completed, Elapsed Time: 0.9588 seconds\n" ] } ], "source": [ "from utils import download_images\n", "download_images(sample_test['image_link'], '../images')" ] }, { "cell_type": "code", "execution_count": 14, "id": "89aaba53", "metadata": {}, "outputs": [], "source": [ "assert len(os.listdir('../images')) > 0" ] }, { "cell_type": "code", "execution_count": 15, "id": "1ba3d802", "metadata": {}, "outputs": [], "source": [ "rm -rf ../images" ] }, { "cell_type": "code", "execution_count": null, "id": "6c38a641", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "conda_python3", "language": "python", "name": "conda_python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.14" } }, "nbformat": 4, "nbformat_minor": 5 }