Skip to content

Commit

Permalink
initial_commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ANarcomey committed Sep 18, 2020
0 parents commit 5b8921c
Show file tree
Hide file tree
Showing 50 changed files with 1,798 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.gem
/Gemfile.lock
/.bundle/
*.gemfile.lock
/_site/

*.swp
*.swo
25 changes: 25 additions & 0 deletions 404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
permalink: /404.html
layout: default
---

<style type="text/css" media="screen">
.container {
margin: 10px auto;
max-width: 600px;
text-align: center;
}
h1 {
margin: 30px 0;
font-size: 4em;
line-height: 1;
letter-spacing: -1px;
}
</style>

<div class="container">
<h1>404</h1>

<p><strong>Page not found :(</strong></p>
<p>The requested page could not be found.</p>
</div>
28 changes: 28 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
source "https://rubygems.org"
# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
# bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
# gem "jekyll", "~> 4.1.1"
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
gem "github-pages", group: :jekyll_plugins
# If you have any plugins, put them here!
group :jekyll_plugins do
gem "jekyll-remote-theme"
end

# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
# and associated library.
platforms :mingw, :x64_mingw, :mswin, :jruby do
gem "tzinfo", "~> 1.2"
gem "tzinfo-data"
end

# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]

63 changes: 63 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# README

These notes accompany the Stanford CS class [**CS131**](http://cs131.stanford.edu/), Computer Vision: Foundations
and Applications. This is a development space for the class notes where you can commit your changes as your team builds
the notes for your assigned lecture, and once you're down we will merge your notes onto the finished website.

Head over to [https://anarcomey.github.io/cs131_notes_dev/](https://anarcomey.github.io/cs131_notes_dev/) to see what the web page notes that you'll create will look like!

## Steps to create your own notes
To begin writing your own notes that will appear on a website like this [https://anarcomey.github.io/cs131_notes_dev/](https://anarcomey.github.io/cs131_notes_dev/), have one team member fork the repository building this web page and configure the fork to build a web page for your team to develop on!

- **Step 1: Fork the repository:** Fork this repository [https://github.com/ANarcomey/cs131_notes_dev](https://github.com/ANarcomey/cs131_notes_dev) into your own GitHub account

<div class="fig figcenter">
<img src="/assets/instructions/fork.png">
</div>

- **Step 2: Enable GitHub Pages:** Enter settings from the menu bar in your forked repo, find the "GitHub Pages" heading, and choose the defaults of "master" branch and "root" directory so that your settings look like the figure below, except "anarcomey" will be replaced with the github username of the team member who created the fork. Don't worry about choosing a theme or any other settings, we've configured that all for you.

<div class="fig figcenter">
<img src="/assets/instructions/settings.png">
<img src="/assets/instructions/pages.png">
</div>

- **Step 3: Link the repository to your GitHub Page:** In your forked repository, edit the file `_config.yml`. Update the `url` field to `https://your_github_username.github.io` and either remove the `email` field or set it to one of your team members emails if you want to receive build updates by email.
<div class="fig figcenter">
<img src="{{ site.baseurl }}/assets/instructions/config.png">
</div>

- **Step 4: Submit:** Create a group Gradescope submission with all of your teammates and submit the url of your GitHub Page containing your notes (e.g. `https://your_github_username.github.io/cs131_notes_dev/` and the url of your repository (e.g. `https://github.com/your_GitHub_username/cs131_notes_dev`).


## Steps to update your notes
Now that your notes are live in your own GitHub fork and running at `https://your_github_username.github.io/cs131_notes_dev/`, you'll want to add content and update them. To do that, find the Markdown file for your lecture in the `_chapters` directory and edit the .md file. Once you've made your desired updates and want to see what they look like online, commit and push your changes to the master branch. The newly pushed code will render online in ~< a minute and you can see your notes! Once you have a handle on the basic mechanics of Markdown, you can write most of your notes without having to push code and render very often. Take a look at some examples and a template with Markdown guidance in the `Intructions` module of the website, and also look at the markdown code creating those pages in the .md files in `_chapters/instructions`.

Since you're working in groups and editing the same Markdown file, it might make things easier to collaboratively edit a shared document. Since this code is in Markdown, Google Colab Notebooks are a great tool! They're the google docs of jupyter notebooks. We've provided an example Colab notebook that you can copy and use for collaboratively developing your notes: [link](https://colab.research.google.com/drive/19B1VAXjzQaxuwxwl8VmERDaZPKHqCjkX?usp=sharing), but you're free to use any tools or collaboration structures you wish!


## Optional local setup
If the iteration time of waiting for the github web page to load your changes is too slow for you, you can install the Ruby and Jekyll software behind the web page on your own machine and render the web page locally. Typically the load time for new changes is under a minute, so you really shouldn't need to do this.

### Local setup

1. Install Jekyll: https://jekyllrb.com/docs/installation/
2. Clone this repository if you haven't already:
```sh
git clone ...
```
3. Install dependencies:
```sh
# From cs131_notes_dev/ directory
bundle install
```

### Local development

1. Launch server:
```sh
# From cs131_notes_dev/ directory
bundle exec jekyll serve
```
2. Navigate to `localhost:4000/cs131_notes_dev/` in your web browser! That / at the end matters!
3. Modify notes and save &mdash; local site should update automatically (just refresh).
12 changes: 12 additions & 0 deletions _chapters/cameras/camera_parameters_and_stereo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: Camera parameters and stereo
keywords: (insert comma-separated keywords here)
order: 18 # Lecture number for 2020
---

**Lorem ipsum** dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident,
sunt in culpa qui officia deserunt mollit anim id est laborum.
6 changes: 6 additions & 0 deletions _chapters/cameras/pinhole_computational_corners.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Pinhole, computationational, and corner cameras
keywords: (insert comma-separated keywords here)
order: 17 # Lecture number for 2020
---

12 changes: 12 additions & 0 deletions _chapters/images/clustering.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: Clustering
keywords: (insert comma-separated keywords here)
order: 10 # Lecture number for 2020
---

**Lorem ipsum** dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident,
sunt in culpa qui officia deserunt mollit anim id est laborum.
12 changes: 12 additions & 0 deletions _chapters/images/color.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: Color
keywords: (insert comma-separated keywords here)
order: 8 # Lecture number for 2020
---

**Lorem ipsum** dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident,
sunt in culpa qui officia deserunt mollit anim id est laborum.
12 changes: 12 additions & 0 deletions _chapters/images/image_models_and_priors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: Image models and priors
keywords: (insert comma-separated keywords here)
order: 7 # Lecture number for 2020
---

**Lorem ipsum** dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident,
sunt in culpa qui officia deserunt mollit anim id est laborum.
12 changes: 12 additions & 0 deletions _chapters/images/segmentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: Segmentation
keywords: (insert comma-separated keywords here)
order: 9 # Lecture number for 2020
---

**Lorem ipsum** dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident,
sunt in culpa qui officia deserunt mollit anim id est laborum.
109 changes: 109 additions & 0 deletions _chapters/instructions/example1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
---
title: Example 1 from CS 231N
keywords:
order: 1
---

This year, the recommended way to work on assignments is through [Google Colaboratory](https://colab.research.google.com/). However, if you already own GPU-backed hardware and would prefer to work locally, we provide you with instructions for setting up a virtual environment.

- [Working remotely on Google Colaboratory](#working-remotely-on-google-colaboratory)
- [Working locally on your machine](#working-locally-on-your-machine)
- [Anaconda virtual environment](#anaconda-virtual-environment)
- [Python venv](#python-venv)
- [Installing packages](#installing-packages)

### Working remotely on Google Colaboratory

Google Colaboratory is basically a combination of Jupyter notebook and Google Drive. It runs entirely in the cloud and comes
preinstalled with many packages (e.g. PyTorch and Tensorflow) so everyone has access to the same
dependencies. Even cooler is the fact that Colab benefits from free access to hardware accelerators
like GPUs (K80, P100) and TPUs which will be particularly useful for assignments 2 and 3.

**Requirements**. To use Colab, you must have a Google account with an associated Google Drive. Assuming you have both, you can connect Colab to your Drive with the following steps:

1. Click the wheel in the top right corner and select `Settings`.
2. Click on the `Manage Apps` tab.
3. At the top, select `Connect more apps` which should bring up a `GSuite Marketplace` window.
4. Search for **Colab** then click `Add`.

**Workflow**. Every assignment provides you with a download link to a zip file containing Colab notebooks and Python starter code. You can upload the folder to Drive, open the notebooks in Colab and work on them, then save your progress back to Drive. We encourage you to watch the tutorial video below which covers the recommended workflow using assignment 1 as an example.

<iframe style="display: block; margin: auto;" width="560" height="315" src="https://www.youtube.com/embed/IZUz4pRYlus" frameborder="0" allowfullscreen></iframe>

**Best Practices**. There are a few things you should be aware of when working with Colab. The first thing to note is that resources aren't guaranteed (this is the price for being free). If you are idle for a certain amount of time or your total connection time exceeds the maximum allowed time (~12 hours), the Colab VM will disconnect. This means any unsaved progress will be lost. <font color="red"><strong>Thus, get into the habit of frequently saving your code whilst working on assignments.</strong></font> To read more about resource limitations in Colab, read their FAQ [here](https://research.google.com/colaboratory/faq.html).

**Using a GPU**. Using a GPU is as simple as switching the runtime in Colab. Specifically, click `Runtime -> Change runtime type -> Hardware Accelerator -> GPU` and your Colab instance will automatically be backed by GPU compute.

If you're interested in learning more about Colab, we encourage you to visit the resources below:

* [Intro to Google Colab](https://www.youtube.com/watch?v=inN8seMm7UI)
* [Welcome to Colab](https://colab.research.google.com/notebooks/intro.ipynb)
* [Overview of Colab Features](https://colab.research.google.com/notebooks/basic_features_overview.ipynb)

### Working locally on your machine
If you wish to work locally, you should use a virtual environment. You can install one via Anaconda (recommended) or via Python's native `venv` module. Ensure you are using Python 3.7 as **we are no longer supporting Python 2**.

#### Anaconda virtual environment
We strongly recommend using the free [Anaconda Python distribution](https://www.anaconda.com/download/), which provides an easy way for you to handle package dependencies. Please be sure to download the Python 3 version, which currently installs Python 3.7. The neat thing about Anaconda is that it ships with [MKL optimizations](https://docs.anaconda.com/mkl-optimizations/) by default, which means your `numpy` and `scipy` code benefit from significant speed-ups without having to change a single line of code.

Once you have Anaconda installed, it makes sense to create a virtual environment for the course. If you choose not to use a virtual environment (strongly not recommended!), it is up to you to make sure that all dependencies for the code are installed globally on your machine. To set up a virtual environment called `cs231n`, run the following in your terminal:

```bash
# this will create an anaconda environment
# called cs231n in 'path/to/anaconda3/envs/'
conda create -n cs231n python=3.7
```

To activate and enter the environment, run `conda activate cs231n`. To deactivate the environment, either run `conda deactivate cs231n` or exit the terminal. Note that every time you want to work on the assignment, you should rerun `conda activate cs231n`.

```bash
# sanity check that the path to the python
# binary matches that of the anaconda env
# after you activate it
which python
# for example, on my machine, this prints
# $ '/Users/kevin/anaconda3/envs/sci/bin/python'
```

You may refer to [this page](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html) for more detailed instructions on managing virtual environments with Anaconda.

**Note:** If you've chosen to go the Anaconda route, you can safely skip the next section and move straight to [Installing Packages](#installing-packages).

<a name='venv'></a>
#### Python venv

As of 3.3, Python natively ships with a lightweight virtual environment module called [venv](https://docs.python.org/3/library/venv.html). Each virtual environment packages its own independent set of installed Python packages that are isolated from system-wide Python packages and runs a Python version that matches that of the binary that was used to create it. To set up a virtual environment called `cs231n`, run the following in your terminal:

```bash
# this will create a virtual environment
# called cs231n in your home directory
python3.7 -m venv ~/cs231n
```

To activate and enter the environment, run `source ~/cs231n/bin/activate`. To deactivate the environment, either run `deactivate` or exit the terminal. Note that every time you want to work on the assignment, you should rerun `source ~/cs231n/bin/activate`.

```bash
# sanity check that the path to the python
# binary matches that of the virtual env
# after you activate it
which python
# for example, on my machine, this prints
# $ '/Users/kevin/cs231n/bin/python'
```

<a name='packages'></a>
#### Installing packages

Once you've **setup** and **activated** your virtual environment (via `conda` or `venv`), you should install the libraries needed to run the assignments using `pip`. To do so, run:

```bash
# again, ensure your virtual env (either conda or venv)
# has been activated before running the commands below
cd assignment1 # cd to the assignment directory

# install assignment dependencies.
# since the virtual env is activated,
# this pip is associated with the
# python binary of the environment
pip install -r requirements.txt
```
Loading

0 comments on commit 5b8921c

Please sign in to comment.