Skip to content

Instantly share code, notes, and snippets.

View Ehsan1997's full-sized avatar
💭
making machines learn how to learn

Muhammad Ehsan ul Haq Ehsan1997

💭
making machines learn how to learn
View GitHub Profile
@Ehsan1997
Ehsan1997 / image_io.py
Last active April 5, 2020 14:31
A small code to create a new dataset with smaller patches for semantic segmentation dataset. Another code to read the data from the new dataset.
"""
This function can be used to read the images from the dataset created by the patchify_dataset.py.
Example Usage:
X_test, y_test = get_images("ModMonuSeg/Test/", (im_width, im_height), gt_extension='png')
"""
def get_images(parent_dir, im_shape, img_folder="TissueImages/", gt_folder="GroundTruth/", gt_extension=None):
tissue_dir = parent_dir + img_folder
gt_dir = parent_dir + gt_folder
im_width, im_height = im_shape
@Ehsan1997
Ehsan1997 / google_search_image_extraction.py
Created March 25, 2020 11:14
Script to Generate Image Classification Dataset from Google Images
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
import time
import urllib.request
from PIL import Image
import os
def cr_folder(folder_name):
if not os.path.exists(folder_name):
os.makedirs(folder_name)
@Ehsan1997
Ehsan1997 / assg1acv-inrn.ipynb
Last active February 3, 2020 19:37
Inception-ResNet-CIFAR100.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Ehsan1997
Ehsan1997 / ResNet-CIFAR100.ipynb
Last active February 3, 2020 19:38
Assg1ACV.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Ehsan1997
Ehsan1997 / Analyze.R
Last active March 18, 2017 18:02
Annalyzing data using R
#Author : Muhammad Ehsan ul Haq
#Read the data from the text file
dataAlpha = read.table("dataAlpha.txt", header = TRUE)
dataBravo = read.table("dataBravo.txt", header = TRUE)
#number of no-responses
noResponseAlpha = sum(dataAlpha == -1)
noResponseBravo = sum(dataBravo == -1)
print(sprintf("Number of no Responses in Alpha = %d", noResponseAlpha))
@Ehsan1997
Ehsan1997 / Main.kt
Last active March 17, 2017 18:53
A program to estimate number of users that a network could support with packet switching by entering the required parameters.
//Author Name : Muhammad Ehsan ul Haq
fun main(args : Array<String>) {
//active probability totalRate/UserNeededRate Required probability
var Users = UsersNumberPrediction(0.25, 8000/500, 0.9)
println("Number of Users that can be connected simultaneously using Packet Switching = " + Users)
println("SMG = " + Users.toDouble()/(8000.0/500.0))
}
fun factorial(A: Int) : Double{
if(A <= 1)