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
" JK Jung's .vmirc | |
" | |
" Reference: | |
" | |
" 1. Sample .vimrc by Martin Brochhaus, presented at PyCon APAC 2012 | |
" https://github.com/mbrochh/vim-as-a-python-ide | |
" 2. https://realpython.com/vim-and-python-a-match-made-in-heaven/ | |
" 3. https://github.com/fisadev/fisa-vim-config | |
" 4. https://github.com/thesheff17/youtube/blob/master/vim/vimrc | |
" 5. https://github.com/amix/vimrc |
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
# -------------------------------------------------------- | |
# Camera Recorder for Tegra X2/X1 | |
# | |
# This program captures video from IP CAM, USB webcam, | |
# or the Tegra onboard camera, adds some watermark on | |
# the video frames and then records it into a TS file. | |
# The code demonstrates how to use cv2.VideoWriter() | |
# while taking advantage of TX2/TX1's H.264 H/W encoder | |
# capabilities. | |
# |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# test_camera.py | |
# | |
# Open an RTSP stream and feed image frames to 'openalpr' | |
# for real-time license plate recognition. | |
import numpy as np | |
import cv2 | |
from openalpr import Alpr |
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
# Feature extractor | |
def extract_features(image_path, vector_size=32): | |
image = imread(image_path, mode="RGB") | |
try: | |
# Using KAZE, cause SIFT, ORB and other was moved to additional module | |
# which is adding addtional pain during install | |
alg = cv2.KAZE_create() | |
# Dinding image keypoints | |
kps = alg.detect(image) | |
# Getting first 32 of them. |
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
# -------------------------------------------------------- | |
# Camera Caffe sample code for Tegra X2/X1 | |
# | |
# This program captures and displays video from IP CAM, | |
# USB webcam, or the Tegra onboard camera, and do real-time | |
# image classification (inference) with Caffe. Refer to the | |
# following blog post for how to set up and run the code: | |
# | |
# https://jkjung-avt.github.io/camera-caffe-threaded/ | |
# |
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
# -------------------------------------------------------- | |
# Camera sample code for Tegra X2/X1 | |
# | |
# This program could capture and display video from | |
# IP CAM, USB webcam, or the Tegra onboard camera. | |
# Refer to the following blog post for how to set up | |
# and run the code: | |
# https://jkjung-avt.github.io/tx2-camera-with-python/ | |
# | |
# Written by JK Jung <[email protected]> |
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
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """ | |
import numpy as np | |
#import cPickle as pickle | |
import _pickle as pickle | |
import gym | |
# hyperparameters | |
H = 200 # number of hidden layer neurons | |
batch_size = 10 # every how many episodes to do a param update? | |
learning_rate = 1e-4 |
NewerOlder