gcc -shared -o libsimpleopencvtest.so -fPIC ./simple_opencv_test.cpp -lopencv_core -lopencv_highgui -lopencv_objdetect -lopencv_imgproc -lopencv_features2d -lopencv_ml -lopencv_calib3d -lopencv_video
python simple_opencv_test.py
Returns: | |
if output_type == 'csv_zip': | |
Flask File -- sends file contents to client using Flask send_from_directory() | |
elif output_type == 'json': | |
Flask File -- sends file contents to client using Flask send_from_directory() |
import os | |
import time | |
import pickle | |
import logging | |
import argparse | |
import numpy as np | |
import tensorflow as tf | |
from tensorflow.python.keras.models import Model | |
from tensorflow.python.keras import backend as K | |
from tensorflow.python.keras.utils import plot_model |
import time | |
from lockfile import LockFile, LockTimeout | |
filepath = '/home/alex/Downloads/blah.txt' | |
lock = LockFile(filepath) | |
if lock.is_locked(): | |
print('Waiting to acquire the file lock...') | |
lock.acquire(timeout=10) |
#.*\n |
#!/bin/sh | |
# usage ./qsub_with_output.sh cnn_match.sh | |
# where cnn_match.sh is a qsub script | |
jobID=$(qsub $1) | |
jobIDNumeric=${jobID//[!0-9]/} | |
echo $jobIDNumeric | |
qstat -s -u am893 |
{"lastUpload":"2018-07-10T04:14:10.448Z","extensionVersion":"v2.9.2"} |
import numpy as np | |
def sample_pairs_siamese(train_X, train_y, batch_size): | |
# Generate a random batch of batch_size samples | |
rand_index = np.random.choice(len(train_X), size=batch_size) | |
batch_xs, batch_ys = train_X[rand_index], train_y[rand_index] | |
new_batch_xs, new_batch_ys = [], [] |
import io | |
import pickle | |
import numpy as np | |
from nltk.tokenize import word_tokenize | |
def load_vectors(fname): | |
fin = io.open(fname, 'r', encoding='utf-8', newline='\n', errors='ignore') | |
n, d = map(int, fin.readline().split()) | |
data = {} | |
for line in fin: |