Skip to content

Commit 1aa5d81

Browse files
Merge pull request #10 from mohammadzainabbas/mohammad
Mohammad
2 parents ad1b305 + f5d7e54 commit 1aa5d81

File tree

3 files changed

+84
-2
lines changed

3 files changed

+84
-2
lines changed
3.81 MB
Binary file not shown.

β€Žnotebooks/Demo.ipynbβ€Ž

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"cell_type": "markdown",
55
"id": "hp-Fcteb5KD4",
66
"metadata": {
7-
"id": "hp-Fcteb5KD4"
7+
"id": "hp-Fcteb5KD4",
8+
"tags": []
89
},
910
"source": [
1011
"## 🎨 Monet like Painting πŸ‘©πŸ»β€πŸŽ¨ with stable diffusion model πŸ‘¨πŸ»β€πŸ’»\n",
@@ -223,7 +224,7 @@
223224
" "
224225
],
225226
"text/plain": [
226-
"<IPython.lib.display.IFrame at 0x12152b910>"
227+
"<IPython.lib.display.IFrame at 0x1309c8e80>"
227228
]
228229
},
229230
"metadata": {},
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
#!/bin/bash
2+
#====================================================================================
3+
# Author: Mohammad Zain Abbas
4+
# Date: 2nd Nov, 2022
5+
#====================================================================================
6+
# This script is used to download the kaggle data for "I am something of a painter myself"
7+
#====================================================================================
8+
9+
# Enable exit on error
10+
set -e -u -o pipefail
11+
12+
log () {
13+
echo "[[ log ]] $1"
14+
}
15+
16+
error () {
17+
echo "[[ error ]] $1"
18+
}
19+
20+
#Function that shows usage for this script
21+
function usage()
22+
{
23+
cat << HEREDOC
24+
25+
Download kaggle data for the Deep Learning Project
26+
27+
Usage:
28+
29+
$progname [OPTION] [Value]
30+
31+
Options:
32+
33+
-p, --path Path for data to be stored. (by default uses 'data')
34+
-h, --help Show usage
35+
36+
Examples:
37+
38+
$ $progname
39+
⚐ β†’ Download kaggle data for your Deep Learning project.
40+
41+
HEREDOC
42+
}
43+
44+
progname=$(basename "$0")
45+
data_dir="data"
46+
47+
#Get all the arguments and update accordingly
48+
while [[ "$#" -gt 0 ]]; do
49+
case $1 in
50+
-p|--path) data_dir="$2"; shift ;;
51+
-h|--help)
52+
usage
53+
exit 1
54+
;;
55+
*) printf "\n$progname: invalid option β†’ '$1'\n\n⚐ Try '$progname -h' for more information\n\n"; exit 1 ;;
56+
esac
57+
shift
58+
done
59+
60+
setup_kaggle_env() {
61+
echo '{"username":"mohammadzainabbas","key":"648d4a46bff4f3fd9380f74378844993"}' > ~/.kaggle/kaggle.json && chmod 600 ~/.kaggle/kaggle.json
62+
}
63+
64+
download_kaggle_data() {
65+
kaggle competitions download -c gan-getting-started -p "$data_dir" --force
66+
}
67+
68+
cleanup() {
69+
rm -rf "$data_dir"/raw_data || echo "Unable to find '$data_dir'/raw_data directory"
70+
unzip -q "$data_dir/gan-getting-started.zip" "photo_jpg/*" -d "$data_dir"/raw_data -f
71+
}
72+
73+
74+
log "Setting up kaggle enviornment ..."
75+
setup_kaggle_env
76+
log "Downloading kaggle data ..."
77+
download_kaggle_data
78+
log "Cleanup and unzipping the data ..."
79+
cleanup
80+
81+
log "All done !!"

0 commit comments

Comments
Β (0)