What frameworks to use?
Whow numpy is different from tensorflow?
Wwhat keras is?
Do we need to know python?
What is anaconda?
Wwhat is venv?
How to setup python packages?
Will it work on windows?
Do we need gpu?
How to deal with python notebooks?

First things first

To have anything possible, we need to setup python properly. Examples will be shown for windows machines now, but it is more or less the same for


In [1]:
1+1


Out[1]:
2

In [4]:
%matplotlib inline

In [20]:
import cv2
import matplotlib.pyplot as plt
import numpy as np
import sys


im = cv2.imread('images/image.jpg')

h,w = im.shape[:2]
print(im.shape)
converted = cv2.cvtColor(im, cv2.COLOR_BGR2HLS)
plt.imshow(converted)
#plt.imshow(im,cmap='summer')
#plt.imshow(converted)
plt.show()


(775, 1024, 3)

Exercises

These exercises will give you some knowledge of python and libraries. Pain included )


In [27]:
# exercise 1
# enumerate all pictures in images folder and print their names
# Hint : use 'glob' package

In [28]:
# Exercise 2
# print filename for each image with corresponding index, 
#  1, image1
#  2, image2
#  3, image3
# Create at least 2 different implementations

In [29]:
# Exercise 3
# print only even numbered images

In [30]:
# Exercise 4
# using numpy find image with most Green in it
# Hint : sum all green channel values and sort

In [31]:
# Exercise 5
# using numpy find image with most Green in it
# Hint : sum all green channel values and sort

In [32]:
# Exercise 6
# using numpy convert image from RGB to BGR

In [33]:
# Exercise 7
# convert image from RGB to BGR without numpy

In [34]:
# Exercise 8
# using numpy convert image from RGB to HSL (http://www.niwa.nu/2013/05/math-behind-colorspace-conversions-rgb-hsl/)

In [35]:
# Exercise 9
# hard
# Without numpy convert image from RGB to HSL (http://www.niwa.nu/2013/05/math-behind-colorspace-conversions-rgb-hsl/)

In [36]:
# Exercise 10
# nightmare
# using tensorflow convert image from RGB to HSL (http://www.niwa.nu/2013/05/math-behind-colorspace-conversions-rgb-hsl/)