Skip to content

Commit 276f3ab

Browse files
committed
Added documentation in the scripts
1 parent 02a7c9a commit 276f3ab

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

Image_Processing/src/cropping/Resizing.py

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
"""
2+
This is small script used for resizing any image. Resizing is useful whenever we have an image dataset having
3+
images of different resolutions. Any model would accept a fixed sized image and so we need to resize the image.
4+
5+
OpenCV provides a direct implementation of resizing the image.
6+
There are 3 arguments in resize()
7+
1. The image to be resized
8+
2. The desired width and height in a tuple.
9+
3. The kind of interpolation. (Choose from AREA, CUBIC, LINEAR, and NEAREST)
10+
"""
111
import cv2
212
dimensions = input("Enter width and height : ").split()
313
width = int(dimensions[0])

Machine_Learning/src/MNIST_using_CNN/mnist.py

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
"""
2+
This file describes implementation of a basic CNN made using Tensorflow and trained and tested with MNIST dataset.
3+
Initially we have all the required dependencies imported.
4+
5+
create_model() describes the CNN architecture used for training a model
6+
7+
plot() is used to plot the images along with their predicted/true labels.
8+
9+
"""
110
import numpy as np
211
import tensorflow as tf
312
import matplotlib.pyplot as plt
@@ -54,5 +63,7 @@ def plot(subset_x, subset_y):
5463

5564
subset_x = x_test[0:10]
5665
subset_y = y_predictions[0:10]
66+
67+
# Used to plot the predicted labels along with images.
5768
plot(subset_x, subset_y)
5869

0 commit comments

Comments
 (0)