{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Image Caption Generator" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "from matplotlib import pyplot as plt\n", "import pandas as pd\n", "import re\n", "import cv2\n", "\n", "import os\n", "from tqdm import tqdm" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Dataset Loading" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "PATH = 'Dataset/'\n", "\n", "IMAGE_PATH = PATH + 'images/'\n", "LABEL_PATH = PATH + 'captions.csv'" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "# Read LABEL_PATH using pandas\n", "df = pd.read_csv(LABEL_PATH, delimiter=',')" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | image | \n", "caption | \n", "
---|---|---|
0 | \n", "1000268201_693b08cb0e.jpg | \n", "A child in a pink dress is climbing up a set o... | \n", "
1 | \n", "1000268201_693b08cb0e.jpg | \n", "A girl going into a wooden building . | \n", "
2 | \n", "1000268201_693b08cb0e.jpg | \n", "A little girl climbing into a wooden playhouse . | \n", "
3 | \n", "1000268201_693b08cb0e.jpg | \n", "A little girl climbing the stairs to her playh... | \n", "
4 | \n", "1000268201_693b08cb0e.jpg | \n", "A little girl in a pink dress going into a woo... | \n", "