Skip to content

Instantly share code, notes, and snippets.

Brian Mount bmount

Block or report user

Report or block bmount

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bmount
bmount / halide_opencl_cache_kernel.cc.diff
Created Jun 7, 2019
minimal diff showing kernel re-use
View halide_opencl_cache_kernel.cc.diff
diff --git a/src/runtime/opencl.cpp b/src/runtime/opencl.cpp
index 3fb98b4..4b5eca2 100644
--- a/src/runtime/opencl.cpp
+++ b/src/runtime/opencl.cpp
+} // extern C
+
+#include <map>
+struct kernel_cache_t { bool cached; cl_kernel kernel; inline kernel_cache_t() : cached(false) {} };
+std::map<const char*, kernel_cache_t> precompiled_kernels;
@bmount
bmount / gstreamer_udp_rtsp.md
Last active Oct 25, 2019
gstreamer udp rtsp
View gstreamer_udp_rtsp.md

Snippets collected/distilled from gists/blog posts/etc. Combined here for fellow web-searchers -- goal is to have an easy/minimal sink for in-app use, and then forward that stream in another process.

Read camera, push to UDP sink (usually from appsrc, here v4l2 camera):

$ gst-launch-1.0 -vvvv v4l2src ! 'video/x-raw, width=640, height=480, framerate=30/1' ! videoconvert ! x264enc pass=qual quantizer=20 tune=zerolatency ! rtph264pay ! udpsink port=1234

Visualize above:

$ gst-launch-1.0 -vvv udpsrc port=1234 ! "application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264" ! rtph264depay ! h264parse ! decodebin ! videoconvert ! xvimagesink sync=false

View sign_apk.txt
keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore some.apk alias_name
@bmount
bmount / tf-transform-graph.example
Created Jul 13, 2017
(Minimal) conversion of TensorFlow object detection graph for inference
View tf-transform-graph.example
bazel build tensorflow/tools/graph_transforms:transform_graph
bazel-bin/tensorflow/tools/graph_transforms/transform_graph --in_graph=../models/object_detection/ssd_mobilenet_v1_coco_11_06_2017/frozen_inference_graph.pb --out_graph=transformed_inference_graph.pb --inputs='image_tensor' --outputs='detection_boxes,detection_scores,detection_classes,num_detections' --transforms='
add_default_attributes
strip_unused_nodes(type=float)
remove_nodes(op=CheckNumerics)
fold_constants(ignore_errors=true)
fold_batch_norms
fold_old_batch_norms
fuse_resize_pad_and_conv
fuse_pad_and_conv
View Train-densenet.protrototxt
layer {
name: "Data1"
type: "Data"
top: "Data1"
top: "Data2"
transform_param {
mean_file: "/home/zl499/caffe/examples/cifar10/mean.binaryproto"
}
data_param {
source: "/home/zl499/caffe/examples/cifar10/cifar10_train_lmdb"
View gist:7cbc28fb1294ab0e4572db091b24af6a
name: "PVANET-lite"
# https://raw.githubusercontent.com/sanghoon/pva-faster-rcnn/master/models/pvanet/lite/original.pt
################################################################################
## Input
################################################################################
layer {
name: 'input-data'
View squeezenet_residual_songhan.prototxt
name: "SqueezeNet_Residual"
layer {
name: "data"
type: "Data"
top: "data"
top: "label"
include {
phase: TRAIN
}
transform_param {
View ssd_train.prototxt
name: "VGG_VOC0712_SSD_300x300_train"
layer {
name: "data"
type: "AnnotatedData"
top: "data"
top: "label"
include {
phase: TRAIN
}
transform_param {
View squeeze_1.1.prototxt
# please cite:
# @article{SqueezeNet,
# Author = {Forrest N. Iandola and Matthew W. Moskewicz and Khalid Ashraf and Song Han and William J. Dally and Kurt Keutzer},
# Title = {SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and $<$1MB model size},
# Journal = {arXiv:1602.07360},
# Year = {2016}
# }
name: "SqueezeNet_1.1"
layer {
name: "data"
View SqueezeNet.prototxt
# please cite:
# @article{SqueezeNet,
# Author = {Forrest N. Iandola and Matthew W. Moskewicz and Khalid Ashraf and Song Han and William J. Dally and Kurt Keutzer},
# Title = {SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and $<$1MB model size},
# Journal = {arXiv:1602.07360},
# Year = {2016}
#}
input: "data"
input_shape {
You can’t perform that action at this time.