Spaces:
Runtime error
Runtime error
Commit
·
87c4a7b
1
Parent(s):
d6c2823
unzipping folder not exist bug fix
Browse files- README.md +2 -0
- kaggle/kernel-metadata.json +16 -0
- kaggle/train-image-colorization.ipynb +55 -0
- src/utils/data_utils.py +2 -1
README.md
CHANGED
|
@@ -74,6 +74,8 @@ An deep learning based Image Colorization project.
|
|
| 74 |
<p><small>Project based on the <a target="_blank" href="https://drivendata.github.io/cookiecutter-data-science/">cookiecutter data science project template</a>. #cookiecutterdatascience</small></p>
|
| 75 |
|
| 76 |
|
|
|
|
|
|
|
| 77 |
### Version 1:
|
| 78 |
|
| 79 |
- im gonna skip logging for now and rather use print statements
|
|
|
|
| 74 |
<p><small>Project based on the <a target="_blank" href="https://drivendata.github.io/cookiecutter-data-science/">cookiecutter data science project template</a>. #cookiecutterdatascience</small></p>
|
| 75 |
|
| 76 |
|
| 77 |
+
Kaggle API docs:- https://github.com/Kaggle/kaggle-api/blob/main/docs/README.md
|
| 78 |
+
|
| 79 |
### Version 1:
|
| 80 |
|
| 81 |
- im gonna skip logging for now and rather use print statements
|
kaggle/kernel-metadata.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"id": "anujpanthri/train-image-colorization",
|
| 3 |
+
"id_no":345,
|
| 4 |
+
"title": "training-image-colorization-model",
|
| 5 |
+
"code_file": "train-image-colorization.ipynb",
|
| 6 |
+
"language": "python",
|
| 7 |
+
"kernel_type": "notebook",
|
| 8 |
+
"is_private": "true",
|
| 9 |
+
"enable_gpu": "false",
|
| 10 |
+
"enable_tpu": "false",
|
| 11 |
+
"enable_internet": "true",
|
| 12 |
+
"dataset_sources": [],
|
| 13 |
+
"competition_sources": [],
|
| 14 |
+
"kernel_sources": [],
|
| 15 |
+
"model_sources": []
|
| 16 |
+
}
|
kaggle/train-image-colorization.ipynb
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"cells": [
|
| 3 |
+
{
|
| 4 |
+
"cell_type": "code",
|
| 5 |
+
"execution_count": null,
|
| 6 |
+
"metadata": {},
|
| 7 |
+
"outputs": [],
|
| 8 |
+
"source": [
|
| 9 |
+
"!git clone https://github.com/AnujPanthri/Image-Colorization.git\n",
|
| 10 |
+
"%cd Image-Colorization"
|
| 11 |
+
]
|
| 12 |
+
},
|
| 13 |
+
{
|
| 14 |
+
"cell_type": "code",
|
| 15 |
+
"execution_count": null,
|
| 16 |
+
"metadata": {},
|
| 17 |
+
"outputs": [],
|
| 18 |
+
"source": [
|
| 19 |
+
"!pip install -r requirements.txt --quiet\n",
|
| 20 |
+
"!pip install -e ."
|
| 21 |
+
]
|
| 22 |
+
},
|
| 23 |
+
{
|
| 24 |
+
"cell_type": "code",
|
| 25 |
+
"execution_count": null,
|
| 26 |
+
"metadata": {},
|
| 27 |
+
"outputs": [],
|
| 28 |
+
"source": [
|
| 29 |
+
"!python3 src/scripts/train.py configs/experiment1.yaml"
|
| 30 |
+
]
|
| 31 |
+
},
|
| 32 |
+
{
|
| 33 |
+
"cell_type": "code",
|
| 34 |
+
"execution_count": null,
|
| 35 |
+
"metadata": {},
|
| 36 |
+
"outputs": [],
|
| 37 |
+
"source": [
|
| 38 |
+
"!python3 src/scripts/visualize_results.py configs/experiment1.yaml"
|
| 39 |
+
]
|
| 40 |
+
}
|
| 41 |
+
],
|
| 42 |
+
"metadata": {
|
| 43 |
+
"kernelspec": {
|
| 44 |
+
"display_name": "Python 3",
|
| 45 |
+
"language": "python",
|
| 46 |
+
"name": "python3"
|
| 47 |
+
},
|
| 48 |
+
"language_info": {
|
| 49 |
+
"name": "python",
|
| 50 |
+
"version": "3.12.1"
|
| 51 |
+
}
|
| 52 |
+
},
|
| 53 |
+
"nbformat": 4,
|
| 54 |
+
"nbformat_minor": 2
|
| 55 |
+
}
|
src/utils/data_utils.py
CHANGED
|
@@ -2,7 +2,7 @@ from src.utils.config_loader import constants
|
|
| 2 |
from huggingface_hub import snapshot_download
|
| 3 |
from zipfile import ZipFile
|
| 4 |
import numpy as np
|
| 5 |
-
import shutil
|
| 6 |
import matplotlib.pyplot as plt
|
| 7 |
import cv2
|
| 8 |
import math
|
|
@@ -25,6 +25,7 @@ def download_personal_hf_dataset(name):
|
|
| 25 |
def unzip_file(file_path,destination_dir):
|
| 26 |
"""unzips file to destination_dir"""
|
| 27 |
shutil.rmtree(destination_dir)
|
|
|
|
| 28 |
with ZipFile(file_path,"r") as zip:
|
| 29 |
zip.extractall(destination_dir)
|
| 30 |
|
|
|
|
| 2 |
from huggingface_hub import snapshot_download
|
| 3 |
from zipfile import ZipFile
|
| 4 |
import numpy as np
|
| 5 |
+
import os,shutil
|
| 6 |
import matplotlib.pyplot as plt
|
| 7 |
import cv2
|
| 8 |
import math
|
|
|
|
| 25 |
def unzip_file(file_path,destination_dir):
|
| 26 |
"""unzips file to destination_dir"""
|
| 27 |
shutil.rmtree(destination_dir)
|
| 28 |
+
os.makedirs(destination_dir)
|
| 29 |
with ZipFile(file_path,"r") as zip:
|
| 30 |
zip.extractall(destination_dir)
|
| 31 |
|