Skip to content

Instantly share code, notes, and snippets.

@salihkaragoz
salihkaragoz / UDP Client Program
Last active April 21, 2017 14:54
You can catch UDP packet as specified port and IP address
using System;
using System.Text;
using System.Net;
using System.Net.Sockets;
namespace Server
{
class Program
{
@salihkaragoz
salihkaragoz / Udp Sender
Created July 10, 2017 09:11
UDPClient Close time for Unreachable Ip with Pyhton
import socket
import time
import datetime
IPADDR = '192.168.1.141'
PORTNUM = 5600
PACKETDATA = "f1a525da11f6".encode()
while(True):
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 0)
**HEADER FILES**
deprecated.h
libvlc.h
libvlc_events.h
libvlc_media.h
libvlc_media_discoverer.h
libvlc_media_library.h
libvlc_media_list.h
libvlc_media_list_player.h
libvlc_media_player.h
@salihkaragoz
salihkaragoz / Tutorial of Numpy
Created August 24, 2017 14:34
Python Numpy Tutorial
# This lecture based on Stanford' Python Numpy Tutorial
def quicksort(arr):
if len(arr) <= 1:
return arr
pivot = arr[len(arr) // 2]
left = [x for x in arr if x < pivot]
middle = [x for x in arr if x == pivot]
right = [x for x in arr if x > pivot]
return quicksort(left) + middle + quicksort(right)

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@salihkaragoz
salihkaragoz / readme.md
Created September 22, 2017 06:18 — forked from baraldilorenzo/readme.md
VGG-16 pre-trained model for Keras

##VGG16 model for Keras

This is the Keras model of the 16-layer network used by the VGG team in the ILSVRC-2014 competition.

It has been obtained by directly converting the Caffe model provived by the authors.

Details about the network architecture can be found in the following arXiv paper:

Very Deep Convolutional Networks for Large-Scale Image Recognition

K. Simonyan, A. Zisserman

@salihkaragoz
salihkaragoz / focal_loss_theano
Last active April 20, 2018 13:05
keras focal loss theano backend
y_true = 2
y_pred = 0.2
if(K.backend()=="tensorflow"):
import tensorflow as tf
sess= tf.Session()
with tf.device('/cpu:0'):
pt = tf.where(tf.equal(y_true, 1), y_pred, 1 - y_pred)
print(sess.run(pt))
if(K.backend()=="theano"):
@salihkaragoz
salihkaragoz / train.py
Last active December 15, 2017 11:41
Training
import numpy as np
from pycocotools.coco import COCO
import os
import math
import keras
from keras.models import Sequential, Model
from keras.layers import Dense, Activation, Input, Flatten, Dropout
from keras.utils import plot_model
import cv2
import matplotlib.pyplot as plt
@salihkaragoz
salihkaragoz / convertor.py
Last active January 26, 2018 06:17
Convert PNGs to JPGs under a folder with opencv
# Written by MSK
import glob
import cv2
pngs = glob('./*.png')
for png in pngs:
img = cv2.imread(png)
cv2.imwrite(png[:-3] + 'jpg', img)
@salihkaragoz
salihkaragoz / labels_1024.tsv
Created February 6, 2018 17:54 — forked from teamdandelion/labels_1024.tsv
TensorBoard: TF Dev Summit Tutorial
We can make this file beautiful and searchable if this error is corrected: No tabs found in this TSV file in line 0.
7
2
1
0
4
1
4
9
5
9