The final submitted assignment (folder - ML Assign 1) contains these files as follows :
1) 1.jpg - Image file to obtain pixel values of R from RGB
2) 2.jpg - Image file to obtain pixel values of G from RGB
3) 3.jpg - Image file to obtain pixel values of B from RGB
4) 4.jpg - Image file to obtain pixel values of I
5) ASSIGNMENT 1 Bayes Decision Rule.ipynb - jupyter notebook file containing implementation of BAYES DECISION RULE to classify points as either river(255) or non-river(0) and create three output files for (P1 = 0.3, P2 = 0.7), (P1 = 0.7, P2 = 0.3) and (P1 = 0.5, P2 = 0.5) respectively
6) ASSIGNMENT_1.py - .ipynb converted to .py for use as per choice
7) ASSIGMENT 1 PDF FORMAT - pdf format of jupyter notebook for reference
For running the jupyter notebook or the python file you need some libraries installed. For that open up a command prompt and type these commands one by one a) pip install numpy b) pip install matplotlib c) pip install pillow
For running the cells in ASSIGNMENT 1 Bayes Decision Rule.ipynb use "Shift + Enter"
For running the python file ASSIGNMENT_1.py use commmand "python ASSIGNMENT_1.py" on a command line
After running each cell in the jupyter notebook (or after running the .py file) you will notice 4 extra image files being created : a) blank.jpg - blank file created to form the final output
b) output1.jpg - output image file corresponding to P1 = 0.3 and P2 = 0.7
c) output2.jpg - output image file corresponding to P1 = 0.7 and P2 = 0.3
d) output3.jpg - output image file corresponding to P1 = 0.5 and P2 = 0.5
There is also a sample output folder which contains an image sample output.jpg (sample output image produced during testing the code)