This file contains 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
# Add in the preamble | |
\usepackage{algorithm} | |
\usepackage[noend]{algpseudocode} | |
\renewcommand{\algorithmicrequire}{\textbf{Input:}} | |
\renewcommand{\algorithmicensure}{\textbf{Output:}} | |
# Content |
This file contains 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 cv2 | |
from detectron2.utils.logger import setup_logger | |
setup_logger() | |
from detectron2.config import get_cfg | |
from detectron2.engine import DefaultPredictor | |
from detectron2.utils.visualizer import Visualizer | |
from detectron2.data import MetadataCatalog | |
# Get image |
This file contains 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 os | |
from shutil import copyfile | |
train_path = '/DATA1/datasets/ILSVRC2012_img_train/imagenet' | |
destination_path = '/DATA1/datasets/ILSVRC2012_img_train/imagenet_all_images' | |
i = 0 | |
for path, dir_name, file_names in os.walk(train_path): | |
i += 1 |
This file contains 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
'pink primrose' | |
'hard-leaved pocket orchid' | |
'canterbury bells' | |
'sweet pea' | |
'english marigold' | |
'tiger lily' | |
'moon orchid' | |
'bird of paradise' | |
'monkshood' | |
'globe thistle' |
This file contains 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 itertools | |
import numpy as np | |
from sklearn.linear_model import SGDClassifier, SGDRanking | |
from sklearn import metrics | |
from minirank.compat import RankSVM as MinirankSVM | |
from scipy import stats | |
This file contains 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
% Retrieving the data | |
data = load('SUN_small_obj_train.mat'); | |
struct_arr = getfield(data, 'SUN_small_obj_train'); | |
% Converting each row to a its corresponding csv | |
fileID = fopen('SUN_small_obj_train.csv','w'); | |
[nrows,ncols] = size(struct_arr); | |
for row = 1:nrows | |
for col = 1:ncols | |
if isempty(struct_arr{row,col}) |
This file contains 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 VGG_ILSVRC_16 Architecture, which contains only Convolutional Layers. | |
# Adapted from: https://gist.github.com/ksimonyan/211839e770f7b538e2d8#file-readme-md | |
name: "VGG_ILSVRC_16_layers" | |
input: "data" | |
input_dim: 10 | |
input_dim: 3 | |
input_dim: 224 | |
input_dim: 224 | |
layers { |
This file contains 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
name: "VDSR" | |
layer { | |
name: "data" | |
type: "HDF5Data" | |
top: "data" | |
top: "label" | |
hdf5_data_param { | |
source: "examples/VDSR/train.txt" | |
batch_size: 64 | |
} |