Skip to content

Instantly share code, notes, and snippets.

View tispratik's full-sized avatar

Pratik Khadloya tispratik

View GitHub Profile
@david-macleod
david-macleod / tf-anchor-box-visualize.py
Last active August 19, 2020 11:39
TensorFlow Object Detection Anchor Box Visualizer
import tensorflow as tf
from object_detection.anchor_generators.multiple_grid_anchor_generator import create_ssd_anchors
from object_detection.models.ssd_mobilenet_v2_feature_extractor_test import SsdMobilenetV2FeatureExtractorTest
import matplotlib.pyplot as plt
from matplotlib import patches
import numpy as np
def get_feature_map_shapes(image_height, image_width):
"""
@Prasad9
Prasad9 / annotation.xml
Created November 6, 2017 13:54
A sample XML annotation file based on Pascal VOC format.
<annotation>
<folder>GeneratedData_Train</folder>
<filename>000001.png</filename>
<path>/my/path/GeneratedData_Train/000001.png</path>
<source>
<database>Unknown</database>
</source>
<size>
<width>224</width>
<height>224</height>
@venik
venik / build_tf.sh
Last active February 22, 2024 06:12
Bash script for local building TensorFlow on Mac/Linux with all CPU optimizations (default pip package has only SSE)
#!/usr/bin/env bash
# Author: Sasha Nikiforov
# source of inspiration
# https://stackoverflow.com/questions/41293077/how-to-compile-tensorflow-with-sse4-2-and-avx-instructions
# Detect platform
if [ "$(uname)" == "Darwin" ]; then
# MacOS
@iconara
iconara / queries.sql
Last active November 13, 2023 22:26
Low level Redshift cheat sheet
-- Table information like sortkeys, unsorted percentage
-- see http://docs.aws.amazon.com/redshift/latest/dg/r_SVV_TABLE_INFO.html
SELECT * FROM svv_table_info;
-- Table sizes in GB
SELECT t.name, COUNT(tbl) / 1000.0 AS gb
FROM (
SELECT DISTINCT datname, id, name
FROM stv_tbl_perm
JOIN pg_database ON pg_database.oid = db_id
@jkreps
jkreps / benchmark-commands.txt
Last active January 21, 2024 11:02
Kafka Benchmark Commands
Producer
Setup
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test-rep-one --partitions 6 --replication-factor 1
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test --partitions 6 --replication-factor 3
Single thread, no replication
bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test7 50000000 100 -1 acks=1 bootstrap.servers=esv4-hcl198.grid.linkedin.com:9092 buffer.memory=67108864 batch.size=8196
@bkimble
bkimble / gist:1365005
Last active March 22, 2024 19:21
List local memcached keys using Ruby
#!/usr/bin/env ruby
# List all keys stored in memcache.
# Credit to Graham King at http://www.darkcoding.net/software/memcached-list-all-keys/ for the original article on how to get the data from memcache in the first place.
require 'net/telnet'
headings = %w(id expires bytes cache_key)
rows = []