Skip to content

Instantly share code, notes, and snippets.

View gireeshkbogu's full-sized avatar

Gireesh Bogu gireeshkbogu

View GitHub Profile
@gireeshkbogu
gireeshkbogu / mask_class_names_modifier.py
Created April 5, 2020 13:41
Changes the unordered class names of multiple image masks in a give folder
import sys
import os
from PIL import Image
import shutil
import numpy as np
mask_dir = "/Users/gireeshbogu/Downloads/MSNYD_8_22_17/MSNYD_8_22_17__AB_AXT1_fl2d_inopp_mbh_15/masks_machine/"
new_mask_dir = "/Users/gireeshbogu/Downloads/MSNYD_8_22_17__AB_AXT1_fl2d_inopp_mbh_15_masks/"
if not os.path.exists(new_mask_dir):
@gireeshkbogu
gireeshkbogu / mask_filter.py
Last active April 8, 2020 19:03
Filter images with at least one mask (sum of all pixels > 0) and copy them to a new folder
# identify images with at least one mask (sum of all pixels > 0) and copy them to a new folder
# usage: script.py mask_dir new_mask_dir
import sys
import os
from PIL import Image
import shutil
import pandas as pd
import numpy as np
@gireeshkbogu
gireeshkbogu / jpg_to_png.py
Last active March 5, 2020 20:27
Convert JPEG format to PNG
from glob import glob
import cv2
jpgs = glob('./*.jpg')
for image in jpgs:
img = cv2.imread(image)
cv2.imwrite(image[:-3] + 'png', img)
@gireeshkbogu
gireeshkbogu / simulate_data.sh
Last active April 5, 2020 14:01
Simulate Omics style data for Machine Learning programs
# Simulate Omics style data for ML
import uuid
import itertools
features = 700
subjects = 40
columns_list = []
@gireeshkbogu
gireeshkbogu / segmentation_kits2019_using_fastai_test_version.ipynb
Last active October 9, 2019 22:01
segmentation_kits2019_using_fastai_test_version
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gireeshkbogu
gireeshkbogu / processing_nii_files.ipynb
Created October 2, 2019 06:09
processing_nii_files.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gireeshkbogu
gireeshkbogu / camvid_small_image_segmentation.ipynb
Created September 22, 2019 22:21
camvid_small_image_segmentation.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gireeshkbogu
gireeshkbogu / classify_surf_skate_boards.ipynb
Created September 9, 2019 23:33
classify_surf_skate_boards.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
library(ggplot2)
# plot volcano plot
res <- read.table("Male_vs_Female_Pre", head=TRUE)
res$Significant <- ifelse(res$adj.P.Val < 0.05, "adj.P.Val < 0.05", "Not Significant")
ggplot(res, aes(x = logFC, y = -log10(P.Value))) +
geom_point(aes(color = Significant)) +
scale_color_manual(values = c("red", "grey")) +
theme_bw(base_size = 12) + theme(legend.position = "bottom") +
geom_text_repel(