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
#!/bin/python3 | |
import math | |
import os | |
import random | |
import re | |
import sys | |
# Complete the diagonalDifference function below. | |
def diagonalDifference(arr): |
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
def draw_lines(img, lines, color=[255, 0, 0], thickness=10): | |
""" | |
NOTE: this is the function you might want to use as a starting point once you want to | |
average/extrapolate the line segments you detect to map out the full | |
extent of the lane (going from the result shown in raw-lines-example.mp4 | |
to that shown in P1_example.mp4). | |
Think about things like separating line segments by their | |
slope ((y2-y1)/(x2-x1)) to decide which segments are part of the left | |
line vs. the right line. Then, you can average the position of each of |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Copyright 2016 Massachusetts Institute of Technology | |
"""Publish a video as ROS messages. | |
""" | |
import argparse |
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
def gen_test_video(sess, logits, keep_prob, input_image, clip, image_shape): #test_image | |
# image = scipy.misc.imresize(scipy.misc.imread(test_image), image_shape) | |
image = clip | |
im_softmax = sess.run( | |
[tf.nn.softmax(logits)], | |
{keep_prob: 1.0, input_image: [image]}) | |
im_softmax = im_softmax[0][:, 1].reshape(image_shape[0], image_shape[1]) | |
segmentation = (im_softmax > 0.5).reshape(image_shape[0], image_shape[1], 1) | |
mask = np.dot(segmentation, np.array([[0, 255, 0, 127]])) |
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
import os.path | |
import tensorflow as tf | |
import helper | |
import freeze | |
import warnings | |
from distutils.version import LooseVersion | |
import project_tests as tests |
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
import os.path | |
import tensorflow as tf | |
import helper | |
import cv2 | |
from distutils.version import LooseVersion | |
# Check TensorFlow Version | |
assert LooseVersion(tf.__version__) >= LooseVersion('1.0'), 'Please use TensorFlow version 1.0 or newer. You are using {}'.format(tf.__version__) | |
print('TensorFlow Version: {}'.format(tf.__version__)) |
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
import numpy as np | |
import matplotlib.pyplot as plt | |
def graph(formula, x_range): | |
x = np.array(x_range) | |
y = formula(x) | |
plt.plot(x, y) | |
plt.show() | |
def my_formula(x): |
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
#!/bin/bash | |
## | |
## This is bash script for saving and loading gnome-terminal session. Special for Ubuntu. | |
## | |
## Usage: ./terminal-session -s <name_profile> - for save session | |
## ./terminal-session -l <name_profile> - for load existing session | |
## ./terminal-session --profiles - for show existing session files | |
## | |
## Instructions: | |
## - Run gnome-terminal; |
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
from gdata.youtube import YouTubeVideoEntry | |
from gdata.youtube.service import YouTubeService | |
import gdata | |
from gdata.service import BadAuthentication, CaptchaRequired | |
from optparse import OptionParser | |
import sys | |
import time | |
import os |
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
/* Smartphones (portrait and landscape) ----------- */ | |
@media only screen | |
and (min-device-width : 320px) | |
and (max-device-width : 480px) { | |
/* Styles */ | |
} | |
/* Smartphones (landscape) ----------- */ | |
@media only screen | |
and (min-width : 321px) { |