-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 87ab29b
Showing
43 changed files
with
7,986 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
|
||
![](graphics/computer_vision_cropped.png) | ||
|
||
## Introduction to Computer Vision | ||
|
||
|
||
|
||
1. Introduction to Computer Vision | ||
2. The State of the Art, Applications, and Using Open Source Code - let's use slides for this. | ||
3. (Optional/Review Session) Introduction to Jupyter + Python of Compter Vision | ||
4. How to do things with fastai | ||
|
||
|
||
## Lectures | ||
|
||
| Notebook/Slides | Recommended Reading/Viewing | Additional Reading/Viewing | Key Topics | | ||
| ------- | ------------- | --------------------------- | -------------------------- | | ||
[A Brief History of Neural Networks](http://www.welchlabs.io/unccv/the_original_problem/notebooks/top.html) | [The Summer Vision Project](papers/summer_vision_project.pdf) | - | - | | ||
|
||
|
||
## Programming Challenge | ||
|
||
|
||
## Setup | ||
The Python 3 [Anaconda Distribution](https://www.anaconda.com/download) is the easiest way to get going with the notebooks and code presented here. | ||
|
||
(Optional) You may want to create a virtual environment for this repository: | ||
|
||
~~~ | ||
conda create -n cv python=3 | ||
source activate cv | ||
~~~ | ||
|
||
You'll need to install the jupyter notebook to run the notebooks: | ||
|
||
~~~ | ||
conda install jupyter | ||
# You may also want to install nb_conda (Enables some nice things like change virtual environments within the notebook) | ||
conda install nb_conda | ||
~~~ | ||
|
||
This repository requires the installation of a few extra packages, you can install them with: | ||
|
||
~~~ | ||
conda install -c pytorch -c fastai fastai | ||
conda install jupyter | ||
conda install opencv | ||
pip install jupyterthemes | ||
~~~ | ||
|
||
(Optional) [jupyterthemes](https://github.com/dunovank/jupyter-themes) can be nice when presenting notebooks, as it offers some cleaner visual themes than the stock notebook, and makes it easy to adjust the default font size for code, markdown, etc. You can install with pip: | ||
|
||
~~~ | ||
pip install jupyterthemes | ||
~~~ | ||
|
||
Recommend jupyter them for **presenting** these notebook (type into terminal before launching notebook): | ||
~~~ | ||
jt -t grade3 -cellw=90% -fs=20 -tfs=20 -ofs=20 -dfs=20 | ||
~~~ | ||
|
||
Recommend jupyter them for **viewing** these notebook (type into terminal before launching notebook): | ||
~~~ | ||
jt -t grade3 -cellw=90% -fs=14 -tfs=14 -ofs=14 -dfs=14 | ||
~~~ | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
## ---------------------------- ## | ||
## | ||
## sample_student.py | ||
## | ||
## Example student submission for programming challenge. Insructions: | ||
## 1. Before submitting, change the name of this file to your firstname_lastname.py. | ||
## 2. Be sure not to change the name of the methods below. | ||
## 3. Complete the methods below using only python and numpy methods. | ||
## 4. ANIT-PLAGARISM checks will be run on your submission, if your code matches another student's too closely, | ||
## we will be required to report you to the office of academic affairs - this may results in failing the course | ||
## or in severe cases, being expelled. | ||
## | ||
## | ||
## ---------------------------- ## | ||
|
||
import numpy as np | ||
|
||
def convert_to_grayscale(im): | ||
''' | ||
Converts an (nxmx3) color image im into an (nxm) grayscale image. | ||
''' | ||
|
||
|
||
|
||
return grayscale_image | ||
|
||
|
||
def crop_image(im, crop_bounds): | ||
''' | ||
Returns a cropped image, im_cropped. | ||
im = numpy array representing a color or grayscale image. | ||
crops_bounds = 4 element long list containing the top, bottom, left, and right crops respectively. | ||
e.g. if crop_bounds = [50, 60, 70, 80], the returned image should have 50 pixels removed from the top, | ||
60 pixels removed from the bottom, and so on. | ||
''' | ||
|
||
|
||
return im_cropped | ||
|
||
def compute_range(im): | ||
''' | ||
Returns the difference between the largest and smallest pixel values. | ||
''' | ||
|
||
|
||
return image_range | ||
|
||
|
||
def maximize_contrast(im, target_range = [0, 255]): | ||
''' | ||
Return an image over same size as im that has been "contrast maximized" by rescaling the input image so | ||
that the smallest pixel value is mapped to target_range[0], and the largest pixel value is mapped to target_range[1]. | ||
''' | ||
|
||
|
||
return image_adujusted | ||
|
||
|
||
def flip_image(im, direction = 'vertical'): | ||
''' | ||
Flip image along direction indicateded by the direction flag. | ||
direction = vertical or horizontal. | ||
''' | ||
|
||
return flipped_image | ||
|
||
def count_pixels_above_threshold(im, threshold): | ||
''' | ||
Return the number of pixels with vaalues above threshold. | ||
''' | ||
|
||
return pixels_above_treshold | ||
|
||
|
||
def normalize(im): | ||
''' | ||
Rescale all pixels value to make the mean pixel value equal zero and the standard deviation equal to one. | ||
if im is of type uint8, convert to float. | ||
''' | ||
|
||
return noramlized_image | ||
|
||
|
||
def resize_image(im, scale_factor): | ||
''' | ||
BONUS PROBLEM - worth 1 extra point. | ||
Resize image by scale_factor using only numpy. | ||
If you wish to sumit a solution, change the return type from None. | ||
''' | ||
|
||
return None | ||
|
||
|
||
|
||
|
||
|
||
|
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.