Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Saleem Ahmed crazysal

🎯
Focusing
View GitHub Profile
@crazysal
crazysal / linking with C C++ libraries with gcc g++ when building an existing project
Created Oct 15, 2020
linking with C/C++ libraries with gcc/g++ when building an existing project
View linking with C C++ libraries with gcc g++ when building an existing project
Notes on linking with C/C++ libraries with gcc/g++ when building an
existing project.
-- Iain Murray, 2015.
There are at least three things that can go wrong when trying to link
with a library that is in a non-standard location on your machine:
1. The compiler can't find the .h header files.
2. The linker can't find the library's binary .a or .so files.
@crazysal
crazysal / cuda_ver.txt
Created Apr 25, 2019
Check Cuda and cuDNN versions
View cuda_ver.txt
cat /usr/local/cuda/version.txt
nvcc --version
cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2
or
cat /usr/include/cudnn.h | grep CUDNN_MAJOR -A 2
@crazysal
crazysal / accmathVOCtriplet.py
Created Mar 5, 2019
Access Math Voc Triplet Data Loader
View accmathVOCtriplet.py
import os
import traceback
import time
import xml.etree.ElementTree as ET
import torch
from torch.utils.data import Dataset
from data.utils import filter_by_shape, extend_bbox, image_channel_mean, bbox_to_quad
from data.transforms import TransformCrop, TransformPad, BinarizerWeightGeneration
@crazysal
crazysal / lstm.pt
Created Jan 10, 2019
simple LSTM PT in caffe
View lstm.pt
name: "LSTM"
input: "data"
input_shape { dim: 320 dim: 1 }
input: "clip"
input_shape { dim: 320 dim: 1 }
input: "label"
input_shape { dim: 320 dim: 1 }
layer {
name: "Silence"
type: "Silence"
@crazysal
crazysal / Decoder.pt
Last active Jan 10, 2019
Decoder training model for end to end textspotter
View Decoder.pt
name : "DECODER"
input: "sample_gt_label_input"
input_shape { dim: 1 dim: 1 }
input2: "sample_gt_cont"
input_shape { dim: 1 dim: 1 }
View textspotter_test_lstm.pt
input: "decoder"
input_shape { dim: 1 dim: 1 dim: 256 }
input: "sample_gt_cont"
input_shape { dim: 1 dim: 1 }
input: "sample_gt_label_input"
input_shape { dim: 1 dim: 1 }
layer {
View textspotter_test_iou.pt
name: "PVANET"
input: "data"
input_shape { dim: 1 dim: 3 dim: 512 dim: 512 }
input: "fcn_th"
input_shape { dim: 1 dim: 1 }
################################################################################
## Convolution
View textspotter_train.pt
name: "PVANET"
layer {
type: "YOU DATA LAYER"
top: "mask_gt" ### 2 * 640 * 640 * 1 ### mask for text/non-text segmentation
top: "mask_iou_angle" ### 1 * 640 * 640 * 5 ### iou with 4 channels and angle with one channel
top: "gt_bbox" ### N * 8 ### grounding truth boxes for text (for computing loss)
top: "ignore_bbox" ### N * 8 ### grounding truth boxes for text (for ignoring)
}
@crazysal
crazysal / cropAndResize.c
Last active Dec 30, 2018
C code to crop and resize a rectangle box from an image to given dimension
View cropAndResize.c
void CropAndResizePerBox(
const float * image_data,
const int batch_size,
const int depth,
const int image_height,
const int image_width,
const float * boxes_data,
const int * box_index_data,
const int start_box,
@crazysal
crazysal / aes_example.c
Created Sep 11, 2018
AES Example code by intel sample library
View aes_example.c
/* ex: set ts=4: */
/*
based on code from http://www.progressive-coding.com/tutorial.php?id=3#end
---------------------------------------------------------------------------
Copyright (c) 2007-2010, Laurent Haan, Luxembourg, LU. All rights reserved.
LICENSE TERMS
The redistribution and use of this software (with or without changes)
is allowed without the payment of fees or royalties provided that: