Template Contents
The following is the directory structure for this template:
- data This directory is used to download images for this solution.
- imagesimilarity This directory contains the imagesimilarity package used for the solution
- Python This contains the Python code to prepare training/testing/evaluation set, train the multi-class classifier and evaluate the model.
- Resources This directory contains other resources for the solution package.
Data
File | Description |
---|---|
download_data.py | Python script to download images named in the **fashion_texture_urls.tsv** file. |
fashion_texture_urls.tsv | list of images and their categorization to be downloaded. |
download_data.bat | Executes **download_data.py** |
Image Similarity
This folder contains a Python package with helper functions that are used both in the **run_image_similarity.py ** code as well as the SQL Stored Procedures.
Model Development in Python
File | Description |
---|---|
Train Model.ipynb | Contains the Jupyter Notebook file that trains the model. |
Test Model.ipynb | Contains the Jupyter Notebook file that demonstrates the model. |
copy_images_to_filetable.py | Populates the SQL database with the image needed for training and testing the model |
parameters.py | Parameters used in run_image_similarity.py |
run_image_similarity.py | featurize images using pre-trained DNN model, prepare training/testing/evaluation image set, train a multi-class classifier and save the model into SQL table, evaluate the image ranking system using evlauation image set, and return top K similar candidates for new query images |
- See For the Data Scientist for more details about these files.
Operationalize in SQL Python
Stored procedures in SQL implement the model training workflow.
- See For the Database Analyst for more information.
- Follow the PowerShell Instructions to execute the PowerShell script which creates these stored procedures.
Resources for the Solution Package
File | Description |
---|---|
.\Resources\ActionScripts\ConfigureSQL.ps1 | Configures SQL, called from ImageSimilaritySetup.ps1 |
.\Resources\ActionScripts\CreateDatabase.sql | Creates the database for this solution, called from ConfigureSQL.ps1 |
.\Resources\ActionScripts\CreateSQLObjectsPy.sql | Creates the tables and stored procedures for this solution, called from ConfigureSQL.ps1 |
.\Resources\ActionScripts\ImageSimilaritySetup.ps1 | Configures SQL, creates and populates database |
.\Resources\ActionScripts\installPyPkg.bat | Installs the imagesimilarity Python package |
.\Resources\ActionScripts\LoadImageData.ps1 | Used to trigger the download of images, upload to SQL, and run the solution workflow. |
.\Resources\ActionScripts\RunOnce.cmd | Used to run LoadImageData.ps1 the first time a user logs onto the VM. |
.\Resources\ActionScripts\SolutionHelp.url | URL to the help page. |