- Python 3.6.5
- pip 19.2.1
- Download git for Windows OR git for MacOS
- pandas to read/write CSV
- opencv-python==4.1.0.25 to calculate similarity scores using SIFT metric
- pytest for unit-testing
- colorama to have colored logs in terminal (dependency for termcolor if os is windows)
- termcolor
- From Terminal run
brew install python
to install python - then run
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
- then
python get-pip.py
- then
pip install -U pip
- Download Python 3.6.5
- Download get-pip to a folder
- Then go to the downloaded folder and run
python get-pip.py
- To upgrade run
python -m pip install -U pip
- dumps - to store test runs
- resources - have test pngs that are used for unit-tests
- tests - unit tests defined for utility functions
- utils - functions defined for calculating similarity, elapsed times and checking if csv contains valid file paths
- When installing git if following option has not been set execute step 2 or 3
- From command prompt, run
set PATH=%PATH%;"C:\Program Files\Git\cmd"
to add git to current session - if Git installed in another directory then do
set PATH=%PATH%;"DRIVE:\DIRECTORY\Git\cmd"
- Run
git clone https://github.com/credo92/Loblaw.git
, DONT' DOWNLOAD - Then go to root folder and then run
pip install -r requirements.txt
to install required libraries - From root folder then run
python image-comparator.py <FILEPATH>
to get results, <FILEPATH>
- a csv file on the system that contains file paths for images that need to be compared- Go to folder/Results.csv to see similarity scores and elapsed times
-
Evaluated options - JavaScript , python then decided on python
-
Ease of reading/writing csv using pandas, image-processing using opencv
-
Calculating runtime of a function call using time module
-
Researched Best metrics to evaluate Similarity between images by reading research papers, springer narrowed it down to SIFT Score
- By Adding unit-tests for functions being used
- By adding assertions in unit-tests using test data
- Manually testing, giving wrong file paths in csv
- By making sure README has all the required steps
- Assisting the user in setting up the terminal utility, installing python and required dependencies
- In order to make sure user gets right requirements, use
pip install -r requirements.txt
to install correct libraries - Demoing the utility , the first time so that user becomes familiar in using the utility
Your manager Jeanie is assigning you to a different task and is making Ferris the maintainer of your application. How do you make sure he succeeds?
- By Making sure the code is readable, testable basically by adding unit-tests and using proper naming/file/variable/function naming conventions
- I am using PEP8 Style Conventions to make sure code can be understood easily
- Using a document generator like Epytext as given in this stackoverflow question
- I have created a subprocess, that basically runs
Popen(["git", "pull", "origin", "master"], stdout=PIPE)
- Everytime the program is run, the process pulls the code from master and then proceeds with the program
- Parse CSV, store its details in a dataframe
- To make sure CSV filepaths are correct, send dataframe to a function
is_csv_good
that returns a booleanTrue or False
- If its
False
in functionis_csv_good
, it labels the incorrect file paths - Then in the calling function
init
we dump a csv file-test<TIMESTAMP>.csv
indumps/
folder so user can fix file paths - If csv is good, call
start_calculating_score_elapsed()
- In
start_calculating_score_elapsed()
Callfunction get_score_elapsed_info_lists()
to get SIFT and elapsed scores lists - From
start_calculating_score_elapsed()
return a dataframe with all info - Convert dataframe to csv using pandas and write to location- current directory\results.csv
getcwd()+'/results.csv'