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
s#!/bin/bash | |
set -e | |
# tensorflow version | |
version=2.6.0 | |
if [[ ! $(head -1 /etc/nv_tegra_release) =~ R32.*6\.1 ]] ; then | |
echo "ERROR: not JetPack-4.6" | |
exit 1 |
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 <jkjung13@gmail.com> |
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 Single-Shot Multibox Detector (SSD) 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 | |
# object detection with Single-Shot Multibox Detector (SSD) | |
# in Caffe. Refer to the following blog post for how to set | |
# up and run the code: | |
# |
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
# export YOUR_GCS_BUCKET=oxford-iiit-pets-dataset | |
gcloud ml-engine jobs submit training `whoami`_object_detection_pets_`date +%m_%d_%Y_%H_%M_%S` \ | |
--runtime-version 1.9 \ | |
--job-dir=gs://${YOUR_GCS_BUCKET}/model_dir \ | |
--packages /home/jkjung/src/tensorflow/models/research/dist/object_detection-0.1.tar.gz,/home/jkjung/src/tensorflow/models/research/slim/dist/slim-0.1.tar.gz,/tmp/pycocotools/pycocotools-2.0.tar.gz \ | |
--module-name object_detection.model_main \ | |
--region asia-east1 \ | |
--config cloud-ssd_mobilenet_v1_pets.yml \ | |
-- \ |
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
"""caffemodel_nv_to_bvlc.py | |
1. compile the nv-caffe's caffe.proto to caffe_pb2.py | |
2. use caffemodel_nv_to_bvlc.py to convert the nv-caffe caffemodel file | |
into bvlc-caffe compatible format. | |
Example usage: | |
$ cd ${HOME}/project/nv-caffe | |
$ protoc src/caffe/proto/caffe.proto --python_out=. | |
$ python3 ./caffemodel_nv_to_bvlc.py <in.caffemodel> <out.caffemodel> |
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
"""crawl_salaries.py | |
For crawling average salaries of all public listed companies on Taiwan | |
Stock Exchange. Data source: https://mops.twse.com.tw/mops/web/t100sb15 | |
Source code reference: | |
https://blog.techbridge.cc/2019/07/26/how-to-use-taiwan-salary-data-to-do-python-data-analytics-and-data-visualization/ | |
Usage: | |
$ python3 crawl_salaries.py |
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
"""dcgan_mnist.py | |
This script was orginally written by Rowel Atienza (see below), and | |
was modified by JK Jung <jkjung13@gmail.com>. | |
------ | |
DCGAN on MNIST using Keras | |
Author: Rowel Atienza | |
Project: https://github.com/roatienza/Deep-Learning-Experiments |
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 keras | |
class DataGenerator(keras.utils.Sequence): | |
'Generates data for Keras' | |
def __init__(self, list_IDs, labels, batch_size=32, dim=(32,32,32), n_channels=1, | |
n_classes=10, shuffle=True): | |
'Initialization' | |
self.dim = dim | |
self.batch_size = batch_size |
NewerOlder