Skip to content

Instantly share code, notes, and snippets.

View Hamza5's full-sized avatar
🏠
Working from home

Hamza Abbad Hamza5

🏠
Working from home
View GitHub Profile
@Hamza5
Hamza5 / ANNfunctions.py
Created June 24, 2017 17:12
Python module containing basic neural networks functions.
# -*- coding: utf-8 -*-
'''
A module containing artificial neural networks functions.
Created by Hamza Abbad.
'''
from numpy import exp,ones,hstack,ndarray,array,zeros,sum,log,zeros_like,any,abs,sqrt
from numbers import Real, Integral
def sigmoid(Z):
# Z is a 2 dimensional array.
@Hamza5
Hamza5 / TextHexadecimal.js
Created May 17, 2017 17:21
Text to hexadecimal and vice versa
function decrypt(s){
return s.split(" ").map(function(c){return String.fromCharCode(parseInt(c,16))}).join("");
}
function encrypt(s) {
return s.split("").map(function(c){return c.codePointAt(c).toString(16)}).join(" ");
}
@Hamza5
Hamza5 / webcam_preview.py
Created November 19, 2016 20:49
Simple PyQt4/OpenCV2 script which uses the Webcam
import sys
import numpy
import cv2
from PyQt4.QtGui import QApplication, QWidget, QLabel, QGroupBox, QVBoxLayout, QImage, QPixmap
from PyQt4.QtCore import QSize, QTimer
# GUI code
app = QApplication(sys.argv)
window = QWidget()
#include <opencv/cv.h>
#include <opencv/highgui.h>
#include <stdio.h>
#include <stdlib.h>
void etirerHistogramme(IplImage ** img){
IplImage * image = *img;
if (image->nChannels != 1) return;
int p_min = 255;