|
| 1 | +{ |
| 2 | + "cells": [ |
| 3 | + { |
| 4 | + "cell_type": "code", |
| 5 | + "execution_count": null, |
| 6 | + "id": "bb8f5b74-74d7-46d8-ab71-6c57b5538af0", |
| 7 | + "metadata": {}, |
| 8 | + "outputs": [], |
| 9 | + "source": [ |
| 10 | + "# Import dataset using kaggle link provided in the repo here.\n", |
| 11 | + "# Note that you have to use google colab for this task.\n", |
| 12 | + "\n" |
| 13 | + ] |
| 14 | + }, |
| 15 | + { |
| 16 | + "cell_type": "code", |
| 17 | + "execution_count": null, |
| 18 | + "id": "32efdd32-13bf-41b7-b42f-0ab5dc84ba34", |
| 19 | + "metadata": {}, |
| 20 | + "outputs": [], |
| 21 | + "source": [ |
| 22 | + "# Write the code for directory arrangement and file naming convention as you did for Task1. \n", |
| 23 | + "\n", |
| 24 | + "\n", |
| 25 | + "\n" |
| 26 | + ] |
| 27 | + }, |
| 28 | + { |
| 29 | + "cell_type": "code", |
| 30 | + "execution_count": null, |
| 31 | + "id": "2271cbbf-e534-4425-aabb-e878c1e6ed78", |
| 32 | + "metadata": {}, |
| 33 | + "outputs": [], |
| 34 | + "source": [ |
| 35 | + "# The directory structure must be maintained as asked in Task1.\n", |
| 36 | + "\n", |
| 37 | + "# /Dataset\n", |
| 38 | + "# /train_set\n", |
| 39 | + "# /class1\n", |
| 40 | + "# /class2\n", |
| 41 | + "# ......\n", |
| 42 | + "# /class21\n", |
| 43 | + "# /class22\n", |
| 44 | + "# /test_set\n", |
| 45 | + "# /class1\n", |
| 46 | + "# /class2\n", |
| 47 | + "# ......\n", |
| 48 | + "# /class21\n", |
| 49 | + "# /class22" |
| 50 | + ] |
| 51 | + }, |
| 52 | + { |
| 53 | + "cell_type": "code", |
| 54 | + "execution_count": null, |
| 55 | + "id": "dd278545-9191-444e-aa6b-ba1239cb7de5", |
| 56 | + "metadata": {}, |
| 57 | + "outputs": [], |
| 58 | + "source": [ |
| 59 | + "# Change this code.\n", |
| 60 | + "train_set = \"path/to/your/train_set\"\n", |
| 61 | + "test_set = \"path/to/your/test_set\"" |
| 62 | + ] |
| 63 | + }, |
| 64 | + { |
| 65 | + "cell_type": "code", |
| 66 | + "execution_count": null, |
| 67 | + "id": "54a23d63-4977-4086-b7a9-358d399f598f", |
| 68 | + "metadata": {}, |
| 69 | + "outputs": [], |
| 70 | + "source": [ |
| 71 | + "# Do not change this code.\n", |
| 72 | + "import os\n", |
| 73 | + "x = os.listdir(train_set)\n", |
| 74 | + "y = os.listdir(test_set)\n", |
| 75 | + "print(f\"Found {len(x)} files in your train_set\")\n", |
| 76 | + "print(x)\n", |
| 77 | + "print(f\"Found {len(y)} files in your test_set\")\n", |
| 78 | + "print(y)" |
| 79 | + ] |
| 80 | + }, |
| 81 | + { |
| 82 | + "cell_type": "code", |
| 83 | + "execution_count": null, |
| 84 | + "id": "ba48388d-6527-487c-8a9c-7c71abc03bed", |
| 85 | + "metadata": {}, |
| 86 | + "outputs": [], |
| 87 | + "source": [ |
| 88 | + "# Generate one-one image of each class. Write the code here.\n", |
| 89 | + "\n", |
| 90 | + "\n", |
| 91 | + "\n" |
| 92 | + ] |
| 93 | + }, |
| 94 | + { |
| 95 | + "cell_type": "markdown", |
| 96 | + "id": "129fbd0a-b235-430d-90e6-c2399d2a74fa", |
| 97 | + "metadata": {}, |
| 98 | + "source": [ |
| 99 | + "<h1>Now we arrive at Task2</h1>" |
| 100 | + ] |
| 101 | + }, |
| 102 | + { |
| 103 | + "cell_type": "code", |
| 104 | + "execution_count": null, |
| 105 | + "id": "f12147c2-c384-4b88-9d8e-496455029b4f", |
| 106 | + "metadata": {}, |
| 107 | + "outputs": [], |
| 108 | + "source": [ |
| 109 | + "# Write the code here.\n", |
| 110 | + "\n", |
| 111 | + "# Print the no. of items in each class in train_set. Also the sum of images in train_set and test_set.\n", |
| 112 | + "# Sum of images in train_set: number1\n", |
| 113 | + "# Sum of images in test_set: number2\n", |
| 114 | + "\n", |
| 115 | + "\n" |
| 116 | + ] |
| 117 | + }, |
| 118 | + { |
| 119 | + "cell_type": "code", |
| 120 | + "execution_count": null, |
| 121 | + "id": "0ec54ac8-7a59-442c-a78a-e5f3c9a95d59", |
| 122 | + "metadata": {}, |
| 123 | + "outputs": [], |
| 124 | + "source": [ |
| 125 | + "# Write image pre-processing code here.\n", |
| 126 | + "\n", |
| 127 | + "\n", |
| 128 | + "\n" |
| 129 | + ] |
| 130 | + }, |
| 131 | + { |
| 132 | + "cell_type": "code", |
| 133 | + "execution_count": null, |
| 134 | + "id": "f749c36d-3ef2-4e29-82e2-4fa0e9ac3452", |
| 135 | + "metadata": {}, |
| 136 | + "outputs": [], |
| 137 | + "source": [ |
| 138 | + "# Generate one-one image of each class. Write the code here.\n", |
| 139 | + "\n", |
| 140 | + "\n", |
| 141 | + "\n" |
| 142 | + ] |
| 143 | + }, |
| 144 | + { |
| 145 | + "cell_type": "code", |
| 146 | + "execution_count": null, |
| 147 | + "id": "82d269d5-3bcf-4124-a86b-59da5d2743df", |
| 148 | + "metadata": {}, |
| 149 | + "outputs": [], |
| 150 | + "source": [ |
| 151 | + "# Write image augmentation code here.\n", |
| 152 | + "\n", |
| 153 | + "\n", |
| 154 | + "\n" |
| 155 | + ] |
| 156 | + }, |
| 157 | + { |
| 158 | + "cell_type": "code", |
| 159 | + "execution_count": null, |
| 160 | + "id": "f0d44d98-f2f9-4497-a9d6-1969c0c51dc9", |
| 161 | + "metadata": {}, |
| 162 | + "outputs": [], |
| 163 | + "source": [ |
| 164 | + "# Generate one-one image of each class. Write the code here.\n", |
| 165 | + "\n", |
| 166 | + "\n" |
| 167 | + ] |
| 168 | + }, |
| 169 | + { |
| 170 | + "cell_type": "code", |
| 171 | + "execution_count": null, |
| 172 | + "id": "c9b66f9a-e001-4e49-b95a-8cfbf49369be", |
| 173 | + "metadata": {}, |
| 174 | + "outputs": [], |
| 175 | + "source": [ |
| 176 | + "# Print the no. of items in each class in train_set. Write the code here.\n", |
| 177 | + "\n", |
| 178 | + "\n" |
| 179 | + ] |
| 180 | + }, |
| 181 | + { |
| 182 | + "cell_type": "code", |
| 183 | + "execution_count": null, |
| 184 | + "id": "9450e74b-d16b-4050-89c9-685f15ea310a", |
| 185 | + "metadata": {}, |
| 186 | + "outputs": [], |
| 187 | + "source": [ |
| 188 | + "# Do we need to handle imbalanced data? Or we handled it already?\n", |
| 189 | + "# Write the code here if not done.\n", |
| 190 | + "\n", |
| 191 | + "\n", |
| 192 | + "\n" |
| 193 | + ] |
| 194 | + }, |
| 195 | + { |
| 196 | + "cell_type": "code", |
| 197 | + "execution_count": null, |
| 198 | + "id": "08587e16-043d-4b82-9484-e85fb2531458", |
| 199 | + "metadata": {}, |
| 200 | + "outputs": [], |
| 201 | + "source": [ |
| 202 | + "# Also generate a validation_set for proper validation to be done while evaluating the model.\n", |
| 203 | + "# 80-20 split.\n", |
| 204 | + "# Make the validation split after correct step.\n", |
| 205 | + "# Print the number of images in train_set and validation_set after you do the split." |
| 206 | + ] |
| 207 | + }, |
| 208 | + { |
| 209 | + "cell_type": "markdown", |
| 210 | + "id": "7bdfa36f-9eec-4799-a279-55f6d7f5acbb", |
| 211 | + "metadata": {}, |
| 212 | + "source": [ |
| 213 | + "# Run all the cells and the colab file must show clear output of all the cells. " |
| 214 | + ] |
| 215 | + }, |
| 216 | + { |
| 217 | + "cell_type": "markdown", |
| 218 | + "id": "75da70f5-ff0f-4161-b56d-f178c48291f0", |
| 219 | + "metadata": {}, |
| 220 | + "source": [ |
| 221 | + "## Write a clean and commented code. Explaining the why and what of the code will help a lot :)" |
| 222 | + ] |
| 223 | + }, |
| 224 | + { |
| 225 | + "cell_type": "code", |
| 226 | + "execution_count": null, |
| 227 | + "id": "b517fe4f-fb4d-4add-8ef6-387ae38dea93", |
| 228 | + "metadata": {}, |
| 229 | + "outputs": [], |
| 230 | + "source": [] |
| 231 | + } |
| 232 | + ], |
| 233 | + "metadata": { |
| 234 | + "kernelspec": { |
| 235 | + "display_name": "Python 3 (ipykernel)", |
| 236 | + "language": "python", |
| 237 | + "name": "python3" |
| 238 | + }, |
| 239 | + "language_info": { |
| 240 | + "codemirror_mode": { |
| 241 | + "name": "ipython", |
| 242 | + "version": 3 |
| 243 | + }, |
| 244 | + "file_extension": ".py", |
| 245 | + "mimetype": "text/x-python", |
| 246 | + "name": "python", |
| 247 | + "nbconvert_exporter": "python", |
| 248 | + "pygments_lexer": "ipython3", |
| 249 | + "version": "3.11.5" |
| 250 | + } |
| 251 | + }, |
| 252 | + "nbformat": 4, |
| 253 | + "nbformat_minor": 5 |
| 254 | +} |
0 commit comments