-
The code is divided into three main pipelines
Preprocessor,Training, andInferencing. -
Each pipeline is run for each category of the products, and creates the artefacts in their respective
outputfolders.
- Create aand activate a virtual environment as follow:
python3 -m venv cods-venv && source cods-venv/bin/activate- Install all the dependencies
pip install -r ./requirements.txt-
downlaod all the pre-finetuned models from the following google drive link : Download Models here and extract the archive into the
./Modelsfolder. -
alternativelly use
gdownas follow:
pip install gdown && \
gdown --folder https://drive.google.com/drive/folders/1SrynpY35WIkubQekjgfLw4ZuDYf--UYI?usp=sharing -O ./Models- Download dataset from Kaggle and unzip the dataset into the
./Datasetfolder. - Alternatively use Kaggle CLI as follow:
kaggle competitions download -c visual-taxonomy -p ./Dataset-
To run the preprocessor, run the individual
.ipynbnotebooks for each category. -
alternatively use the following one-liner from bash shell to run all the preprocessor notebooks at once (Please ensure adequate RAM and CPU power are present in machine to handle all the notebooks at once).
cd Preprocessor-FillNA && \
(trap "pkill -P $$" SIGINT; for notebook in *.ipynb; do jupyter nbconvert --to notebook --execute "$notebook" --output "${notebook%.ipynb}_executed.ipynb" & done; wait)-
Ensure you have ran the preprocessor code and the outputs are generated in
./Preprocessor-FillNA/output. -
Run individual
.ipynbnotebooks for each category. -
The code will save the models in the
./Models/<category>folder for each category.
-
To run inference, please ensure all the models are downloaded from google drive and placed in the correct folder.
-
Run the individual
.ipynbnotebooks for each category to generate the output in theoutputfolder and respective category folders too. -
One liner to run all the
.ipynbnotebooks from command line :
cd Inferencing && \
(trap "pkill -P $$" SIGINT; find . -type f -name "*.ipynb" | while read notebook; do jupyter nbconvert --to notebook --execute "$notebook" --output "${notebook%.ipynb}_executed.ipynb" & done; wait)-
To create the final submission file, run
Submission_File_Prep.ipynbthis will create thesubmission.csvfile in the root folder. -
To run the same from command line please use the following:
jupyter nbconvert --to notebook --execute ./Submission_File_Prep.ipynb --output Submission_File_Prep_executed.ipynb