Skip to content

Instantly share code, notes, and snippets.

View vatsal-sodha's full-sized avatar

Vatsal Sodha vatsal-sodha

  • Tempe, Arizona
View GitHub Profile
@vatsal-sodha
vatsal-sodha / gist:e29451d82815aa82aec2ec5c822a561c
Created October 16, 2016 20:10
Python Function for generating hamming code and detecting single bit error for any size of data
#function to check no of parity bits in genration of hamming code
#return no of parity bits required to append in given size of data word
def noOfParityBits(noOfBits):
i=0
while 2.**i <= noOfBits+i: # (power of 2 + parity bits laready counted) that is for 4 bit of dataword requires 3 bit of parity bits
i+=1
return i
#function to genrate no of parity bits in while correction of hamming codes returns no of parity bits in given size of code word
def noOfParityBitsInCode(noOfBits):
i=0
@vatsal-sodha
vatsal-sodha / HammingCode.py
Created October 16, 2016 20:12
Python function for generating hamming code and detecting single bit error for any size of data length
#function to check no of parity bits in genration of hamming code
#return no of parity bits required to append in given size of data word
def noOfParityBits(noOfBits):
i=0
while 2.**i <= noOfBits+i: # (power of 2 + parity bits laready counted) that is for 4 bit of dataword requires 3 bit of parity bits
i+=1
return i
#function to genrate no of parity bits in while correction of hamming codes returns no of parity bits in given size of code word
def noOfParityBitsInCode(noOfBits):
i=0
@vatsal-sodha
vatsal-sodha / nodules.csv
Created March 26, 2018 10:17
For TensorFlow object detection API tutorial
class fileName height width xmax xmin ymax ymin
nodule subset0_0.jpg 11.64560862 11.64560862 417.82280431 406.17719569 344.82280431 333.17719569
nodule subset0_1.jpg 7.310399552 7.310399552 103.655199776 96.344800224 306.655199776 299.344800224
nodule subset0_2.jpg 10.83118822 10.83118822 446.41559411 435.58440589 315.41559411 304.58440589
nodule subset0_3.jpg 7.244054524 7.244054524 161.622027262 154.377972738 286.622027262 279.377972738
nodule subset0_4.jpg 8.368487089 8.368487089 152.1842435445 143.8157564555 355.1842435445 346.8157564555
nodule subset0_5.jpg 9.25825997 9.25825997 180.629129985 171.370870015 278.629129985 269.370870015
@vatsal-sodha
vatsal-sodha / generate_tfRecord.py
Created March 26, 2018 10:40
Generating tfRecords for TensoFlow Object Detection API
"""
Usage:
# From tensorflow/models/
# Create train data:
python generate_tfrecord.py --csv_input=data/train_labels.csv --output_path=train.record
# Create test data:
python generate_tfrecord.py --csv_input=data/test_labels.csv --output_path=test.record
"""
from __future__ import division
item {
id: 1
name: 'nodule'
}
@vatsal-sodha
vatsal-sodha / faster_rcnn_resnet50_pets.config
Created July 1, 2018 13:35
Faster R-CNN with Resnet-50 config file
# Faster R-CNN with Resnet-50 (v1), configured for Oxford-IIIT Pets Dataset.
# Users should configure the fine_tune_checkpoint field in the train config as
# well as the label_map_path and input_path fields in the train_input_reader and
# eval_input_reader. Search for "PATH_TO_BE_CONFIGURED" to find the fields that
# should be configured.
model {
faster_rcnn {
num_classes: 37
image_resizer {
@vatsal-sodha
vatsal-sodha / grid_anchor_generator.proto
Created July 28, 2018 08:10
grid_anchor_generator.proto
syntax = "proto2";
package object_detection.protos;
// Configuration proto for GridAnchorGenerator. See
// anchor_generators/grid_anchor_generator.py for details.
message GridAnchorGenerator {
// Anchor height in pixels.
optional int32 height = 1 [default = 256];
syntax = "proto2";
package object_detection.protos;
import "object_detection/protos/faster_rcnn.proto";
import "object_detection/protos/ssd.proto";
// Top level configuration for DetectionModels.
message DetectionModel {
oneof model {
syntax = "proto2";
package object_detection.protos;
// Configuration proto for image resizing operations.
// See builders/image_resizer_builder.py for details.
message ImageResizer {
oneof image_resizer_oneof {
KeepAspectRatioResizer keep_aspect_ratio_resizer = 1;
FixedShapeResizer fixed_shape_resizer = 2;