Skip to content

Instantly share code, notes, and snippets.

View andrewssobral's full-sized avatar
🔴
I may be very slow to respond.

Andrews Cordolino Sobral andrewssobral

🔴
I may be very slow to respond.
View GitHub Profile
@andrewssobral
andrewssobral / tegra-cam.py
Created June 2, 2018 23:10 — forked from jkjung-avt/tegra-cam.py
Capture and display video from either IP CAM, USB webcam, or the Tegra X2/X1 onboard camera.
# --------------------------------------------------------
# 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>
@andrewssobral
andrewssobral / install-tensorflow.md
Created June 3, 2018 22:53 — forked from vellamike/install-tensorflow.md
Install tensorflow on Jetson TX2 (Jetpack 3.2)

Building TensorFlow from source for Jetson TX2 with Jetpack 3.2

Jetpack 3.2 includes Cuda 9 and CuDNN 7 so it is necessary to compile it from source.

Step 1 - Get Java

sudo apt-get install openjdk-8-jdk

Step 2 - Get some dependencies

@andrewssobral
andrewssobral / cling_opencv_example.cpp
Created June 15, 2018 14:07
cling for opencv example
// cat cling_opencv_example.cpp | cling
.L /usr/lib/libopencv_highgui.so
#include <opencv/highgui.h>
#include <math.h>
#include <iostream>
using namespace std;
template <typename T> T deg2rad(T deg) { return deg*M_PI/180.0; }
@andrewssobral
andrewssobral / run_luigi.py
Created July 25, 2018 13:43 — forked from bonzanini/run_luigi.py
Example of Luigi task pipeline
# run with a custom --n
# python run_luigi.py SquaredNumbers --local-scheduler --n 20
import luigi
class PrintNumbers(luigi.Task):
n = luigi.IntParameter(default=10)
def requires(self):
return []
@andrewssobral
andrewssobral / jupyter_client.py
Created September 23, 2018 00:29
Jupyter Client (Python)
from jupyter_client.kernelspec import NATIVE_KERNEL_NAME
from jupyter_client.manager import start_new_kernel
km, kc = start_new_kernel(kernel_name=NATIVE_KERNEL_NAME)
def run_cell(client, code, timeout=15):
print("\nrunning: ", code)
reply = client.execute_interactive(code, timeout=timeout)
status = reply['content']['status']
if status == 'ok':
@andrewssobral
andrewssobral / pytorch_jetson_install.sh
Created September 23, 2018 17:48 — forked from dusty-nv/pytorch_jetson_install.sh
Install procedure for pyTorch on NVIDIA Jetson TX1/TX2
#!/bin/bash
#
# pyTorch install script for NVIDIA Jetson TX1/TX2,
# from a fresh flashing of JetPack 2.3.1 / JetPack 3.0 / JetPack 3.1
#
# for the full source, see jetson-reinforcement repo:
# https://github.com/dusty-nv/jetson-reinforcement/blob/master/CMakePreBuild.sh
#
# note: pyTorch documentation calls for use of Anaconda,
# however Anaconda isn't available for aarch64.
@andrewssobral
andrewssobral / slack_dark_theme.js
Created October 8, 2018 13:34
slack_dark_theme
// First make sure the wrapper app is loaded
// https://github.com/widget-/slack-black-theme/issues/48
// alias slackdark='cat ~/slack_dark_theme.js >> /Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static/ssb-interop.js'
document.addEventListener("DOMContentLoaded", function() {
// Then get its webviews
let webviews = document.querySelectorAll(".TeamView webview");
// Fetch our CSS in parallel ahead of time
const cssPath = 'https://cdn.rawgit.com/widget-/slack-black-theme/master/custom.css';
@andrewssobral
andrewssobral / SpatialUpSamplingBilinear.cu
Created October 15, 2018 09:02
SpatialUpSamplingBilinear.cu
#ifndef THC_GENERIC_FILE
#define THC_GENERIC_FILE "generic/SpatialUpSamplingBilinear.cu"
#else
#include "../linear_upsampling.h"
//#define MAX_THREADS_PER_BLOCK 256
//#define MIN_BLOCKS_PER_MP 2
//__launch_bounds__(MAX_THREADS_PER_BLOCK, MIN_BLOCKS_PER_MP)
@andrewssobral
andrewssobral / intel-realsense-dfu
Created October 16, 2018 20:13
intel-realsense-dfu
ubuntu@ubuntu1604:~$ intel-realsense-dfu -b 001 -d 006 -f -i Signed_Image_UVC_5_10_6_0.bin
D400 busnum = 1
D400 devnum = 6
D400 FW file path = Signed_Image_UVC_5_10_6_0.bin
FW Version of .bin File = 5.10.6.0
FW version on device = 5.8.15.0
MM FW Version = 255.255.255.255
FW update required...
Updating FW...
DFU FW version in file = 5.10.6.0