This file contains hidden or 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
# Modified 2016-06-30 by Josiah Olson to add python3 support | |
# Context manager to generate batches in the background via a process pool | |
# Usage: | |
# | |
# def batch(seed): | |
# .... # generate minibatch | |
# return minibatch | |
# | |
# with BatchGenCM(batch) as bg: | |
# minibatch = next(bg) |
This file contains hidden or 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
from __future__ import absolute_import | |
from __future__ import print_function | |
import numpy as np | |
from keras.models import Sequential, Model | |
from keras.layers import Dense, Dropout, Lambda, merge, BatchNormalization, Activation, Input, Merge | |
from keras import backend as K | |
def euclidean_distance(vects): |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 hidden or 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
<script type="text/javascript">// <![CDATA[ | |
function resizeIframe(ifrm) { ifrm.style.height = ifrm.contentWindow.document.body.scrollHeight + 'px'; // Setting the width here, or setting overflowX to "hidden" as above both // work for this page. It may be that one turns out to be better. ifrm.style.width = ifrm.contentWindow.document.body.scrollWidth + 'px'; } | |
// ]]></script> | |
<script type="text/javascript">// <![CDATA[ | |
function onLoad() { var ifrm = document.getElementById('ipython_notebook_frame'); setTimeout(resizeIframe, 0, ifrm); } | |
// ]]></script> | |
<div class="cell border-box-sizing text_cell rendered"> | |
<div class="inner_cell"> | |
<div class="text_cell_render border-box-sizing rendered_html"> |
This file contains hidden or 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 errno | |
import os | |
import signal | |
import time | |
class TimeoutError(Exception): | |
pass | |
class timeout: | |
def __init__(self, seconds=1, error_message='Timeout'): |
This file contains hidden or 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
# coding: utf-8 | |
# # DressRank traning | |
# In[ ]: | |
import mxnet as mx | |
from mxnet.utils import * | |
import logging |
This file contains hidden or 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
#include<opencv2/opencv.hpp> | |
#include<opencv2/imgproc.hpp> | |
#include<opencv2/imgcodecs/imgcodecs.hpp> | |
#include<opencv2/videoio.hpp> | |
#include<iostream> | |
#include<vector> | |
int main(int argc, char *argv[]) | |
{ | |
cv::Mat frame; |
This file contains hidden or 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
#include "caffeclassifier.h" | |
CaffeClassifier::CaffeClassifier(const string& model_file, | |
const string& trained_file, | |
const string& mean_file, | |
const string& label_file, | |
const bool use_GPU, | |
const int batch_size) { | |
if (use_GPU) | |
Caffe::set_mode(Caffe::GPU); |