Skip to content

Instantly share code, notes, and snippets.

@wangg12
wangg12 / trim_detectron_model.py
Created December 18, 2018 03:07
trim last layers of detectron model for maskrcnn-benchmark
import os
import torch
import argparse
from maskrcnn_benchmark.config import cfg
from maskrcnn_benchmark.utils.c2_model_loading import load_c2_format
def removekey(d, listofkeys):
r = dict(d)
for key in listofkeys:
ubuntu 14.04 64bit caffe model -> ncnn model -> ncnn android ->android apk
0、protobuf 安装 //没这玩意儿opencv都编译不过
sudo apt-get install autoconf automake libtool curl make g++ unzip
git clone https://github.com/google/protobuf.git
./autogen.sh
./configure
make
make check
sudo make install
@albertstartup
albertstartup / setup.sh
Last active March 7, 2018 02:22
script to automatically setup nvidia driver 367.27, cuda 8, cudnn 5, on aws gpu
#!/bin/bash
set -o nounset
set -o errexit
# Required!
# downloads/ directory with:
# cuda_8.0.27_linux.run with md5 checksum: bea6165ccd0a6690cac04ed9544bbe57
# cudnn-8.0-linux-x64-v5.0-ga.tgz with md5 checksum: be1896b0db052a7ca06a062262c4b842
NVIDIA_FILENAME=NVIDIA-Linux-x86_64-367.27.run
@tnarihi
tnarihi / upsampling-with-deconv-layer.ipynb
Last active March 19, 2019 16:11
Upsampling with DeconvolutionLayer in Caffe. Open as a notebook here: http://nbviewer.ipython.org/gist/tnarihi/54744612d35776f53278
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@onauparc
onauparc / C++ Predict with caffe
Created June 17, 2014 13:36
sample code for caffe C++ prediction
#include <cuda_runtime.h>
#include <cstring>
#include <cstdlib>
#include <vector>
#include <string>
#include <iostream>
#include <stdio.h>
#include "caffe/caffe.hpp"
@chrisb
chrisb / gist:4d6a09c6cc1ca2e1b14e
Last active November 25, 2022 04:15
Homebrew, Ruby, and Rails on OS X 10.10

OS X 10.10 Guide

Here's what I did to get things working.

1. Install Xcode 6

Yep, over at: https://developer.apple.com

2. Install the Command Line Tools (CLT)

#!/usr/bin/env ruby
exit unless ARGV.length == 1
files = Dir.glob(ARGV[0] + '/*.txt')
files.each do |file|
name = nil;
File.new(file).each_line do |line|
next if line[0] == '#'
term_.prefs_.set('color-palette-overrides', {"0":"#073642","1":"#dc322f","2":"#E4E465","3":"#b58900","4":"#268bd2","5":"#d33682","6":"#2aa198","7":"#eee8d5","8":"#002b36","9":"#cb4b16","10":"#586e75","11":"#657b83","12":"#839496","13":"#6c71c4","14":"#93a1a1","15":"#fdf6e3"});
term_.prefs_.set('background-color', '#002b36');
term_.prefs_.set('cursor-color', '#eee8d5');
term_.prefs_.set('foreground-color', '#eee8d5');
@umpirsky
umpirsky / A.markdown
Last active August 3, 2023 18:14 — forked from olivierlacan/An_example.markdown
Sublime Text Monokai Sidebar Theme.
@kevinhughes27
kevinhughes27 / opencv_blackfly.cpp
Last active November 12, 2025 13:56
A simple program showing how to capture from a Point Grey Research Camera and display the image using OpenCV
#include "FlyCapture2.h"
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
using namespace FlyCapture2;
int main()