Skip to content

Instantly share code, notes, and snippets.

import java.net.*;
public class IdentifyHostNameIP {
public static void main(String[] args) {
for (int i = 0; i < args.length; i++) {
try {
InetAddress address = InetAddress.getByName(args[i]);
System.out.print("Host name: " + address.getHostName() + " ");
System.out.println("IP address: " + address.getHostAddress());
}
@alpercalisir
alpercalisir / changeDirectoryName.py
Last active December 27, 2018 14:58
Change the name of the sub directories such that they will be aligned with their parent directory name. Used for VGGFace 2 Dataset.
import os
import os.path
from os.path import basename
rootDir = 'img'
for dirName, subdirList, fileList in os.walk(rootDir):
#print('Found directory: %s' % dirName)
for fname in fileList:
base = basename(dirName)
location=dirName+'/'+fname
@alpercalisir
alpercalisir / split-video-by-frame.py
Last active December 30, 2018 20:17
Split video by frame
import cv2
import numpy as np
import os
cap = cv2.VideoCapture('IMG_4230.MOV')
if not os.path.exists('training_images'):
os.makedirs('training_images')
userid = 'x'
@alpercalisir
alpercalisir / aug.py
Created December 24, 2018 23:12
Classification augmentation
import cv2
import numpy as np
import random
import os
def saveImg(img, name,location):
img = cv2.resize(img,(416, 416))
cv2.imwrite(location + name + '.jpg', img)
@alpercalisir
alpercalisir / yolov3format.py
Created November 25, 2018 15:22
Gets VGGFace2 dataset and changes it into yolo v3 format
import pandas as pd
import numpy as np
from lxml import etree
#import xmlAnnotation.etree.cElementTree as ET
import xml.etree.ElementTree as ET
fields = ['NAME_ID', 'XMIN', 'YMIN', 'W', 'H', 'XMAX', 'YMAX']
df = pd.read_csv('loose_bb_test.csv', usecols=fields)
@alpercalisir
alpercalisir / xmlAnnotation.py
Created November 24, 2018 13:58
Creates PASCAL VOC formatted XML given a csv file
import pandas as pd
import numpy as np
from lxml import etree
import xmlAnnotation.etree.cElementTree as ET
fields = ['NAME_ID', 'XMIN', 'YMIN', 'W', 'H', 'XMAX', 'YMAX']
df = pd.read_csv('loose_bb_test.csv', usecols=fields)
# Change the name of the file.
import pandas as pd
import numpy as np
fields = ['FACE_X','FACE_Y','FACE_WIDTH','FACE_HEIGHT']
df = pd.read_csv('a.txt', usecols=fields)
df['FACE_WIDTH']=df['FACE_X']+df['FACE_WIDTH']
df['FACE_HEIGHT']=df['FACE_Y']+df['FACE_HEIGHT']
{
"info": {
"_postman_id": "72b09010-cdd7-c939-4977-1903ed6ea654",
"name": "Ulens v.2.0",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Register",
"request": {
@model List<Ulens.Models.UserSupervisorRelationship>
@{
ViewBag.Title = "Kullanıcı/Amir İlişkileri";
}
<h2>Kullanıcı/Amir İlişkileri</h2>
<link href="~/Content/pnotify.css" rel="stylesheet" />
<link href="~/Content/dataTables.bootstrap.min.css" rel="stylesheet" />
<link href="~/Content/responsive.bootstrap.min.css" rel="stylesheet" />
<link href="~/Content/babel.css" rel="stylesheet" />
@alpercalisir
alpercalisir / hepsiburada_Price_Retriever.py
Created February 17, 2018 21:44
Retrieves the price of a product from Hepsiburada
#Hepsiburada Price Retriever
#Used lxml,beatifulsoup4
import bs4 as bs
import urllib.request #In order to request
url = input("Enter Hepsiburada URL: ")
sauce = urllib.request.urlopen(url).read() #Returns the source code of the given URL