Skip to content

Instantly share code, notes, and snippets.

:octocat:
ikigai

Sanzhar Askaruly tuttelikz

:octocat:
ikigai
Block or report user

Report or block tuttelikz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tuttelikz
tuttelikz / NaiveBayes.py
Last active Oct 4, 2019
Naive Bayes From Scratch in Python
View NaiveBayes.py
#How To Implement Naive Bayes From Scratch in Python
#http://machinelearningmastery.com/naive-bayes-classifier-scratch-python/
#Dataset
#https://archive.ics.uci.edu/ml/machine-learning-databases/pima-indians-diabetes/pima-indians-diabetes.data
import csv
import math
import random
#Handle data
@tuttelikz
tuttelikz / Histogram Equalization OpenCV C++
Created Sep 21, 2016
This Gist gives a code snippet for histogram equalization in OpenCV. In line 63, you should enter your source image name
View Histogram Equalization OpenCV C++
#include <iostream>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using namespace std;
using namespace cv;
//function to take histogram of input image
void imageHistogram(Mat image, int histogram[]) {
// initialize all intensity values to 0
@tuttelikz
tuttelikz / bilateral_filter.m
Created May 6, 2017
Bilateral Filter - MATLAB
View bilateral_filter.m
clc, close all, clear all;
img = imread('puppy.jpg');
A = rgb2gray(img);
[m,n] = size(A);
%Filter Parameters setup
windowSize = input('Enter window size (3/5/7):\n ');
stDevSpace = input('Enter space standard deviation (1-20):\n ');
@tuttelikz
tuttelikz / Rename_files.txt
Created Jan 4, 2018
Rename filename bash
View Rename_files.txt
num=0; for i in *; do mv "$i" "$(printf '%04d' $num).${i#*.}"; ((num++)); done
@tuttelikz
tuttelikz / add_prefix_to_filename.txt
Created Jan 18, 2018
Bash command for adding prefix
View add_prefix_to_filename.txt
for f in * ; do mv "$f" "PRE_$f" ; done
@tuttelikz
tuttelikz / write_labels_tofile.py
Created Jan 18, 2018
This is a python script to write list characters into file
View write_labels_tofile.py
thefile = open('train_test_data_labels.txt', 'w')
for item in y_train_test_list:
thefile.write("%s\n" % item)
@tuttelikz
tuttelikz / read_labels_fromfile.py
Created Jan 18, 2018
This is a simple script to read labels from file
View read_labels_fromfile.py
array = []
with open('train_test_data_labels.txt') as fileobj:
for line in fileobj:
for ch in line:
array.append(ch)
#print(ch)
new_list = [a for a in array if a != '\n']
@tuttelikz
tuttelikz / copy_folders_without_contents
Created Jan 20, 2018
This is a bash command on windows to copy folders structure without contents
View copy_folders_without_contents
xcopy C:\Folders D:\Folders /t /e
View copy_to_remote_windows
# After installation of PuTTY, open command window prompt and type the following:
//For copying folder:
pscp -r source destination
//For copying file:
pscp source destination
@tuttelikz
tuttelikz / run_multiple_script_command
Created Jan 20, 2018
For running multiple bash commands
View run_multiple_script_command
#This is an example how to run multiple bash commands together
# Just put && symbol between commands
cd o_cheek/ && num=0; for i in *; do mv "$i" "$(printf 'cheek_old_%04d' $num).${i#*.}"; ((num++)); done && cd .. && mv o_cheek cheek_old && cd o_eye/ && num=0; for i in *; do mv "$i" "$(printf 'eye_old_%04d' $num).${i#*.}"; ((num++)); done && cd .. && mv o_eye eye_old && cd o_forearm/ && num=0; for i in *; do mv "$i" "$(printf 'forearm_old_%04d' $num).${i#*.}"; ((num++)); done && cd .. && mv o_forearm forearm_old && cd y_cheek/ && num=0; for i in *; do mv "$i" "$(printf 'cheek_young_%04d' $num).${i#*.}"; ((num++)); done && cd .. && mv y_cheek cheek_young && cd y_eye/ && num=0; for i in *; do mv "$i" "$(printf 'eye_young_%04d' $num).${i#*.}"; ((num++)); done && cd .. && mv y_eye eye_young && cd y_forearm/ && num=0; for i in *; do mv "$i" "$(printf 'forearm_young_%04d' $num).${i#*.}"; ((num++)); done && cd .. && mv y_forearm forearm_young
You can’t perform that action at this time.