Skip to content

Instantly share code, notes, and snippets.

View ibrandiay's full-sized avatar

IBRA NDIAYE ibrandiay

View GitHub Profile
@ibrandiay
ibrandiay / from_crash.py
Last active March 14, 2022 10:33
train model from crash
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Imports
import numpy as np
# Each row is a training example, each column is a feature [X1, X2, X3]
X=np.array(([0,0,1],[0,1,1],[1,0,1],[1,1,1]), dtype=float)
y=np.array(([0],[1],[1],[0]), dtype=float)
@ibrandiay
ibrandiay / horloge1.py
Created February 8, 2022 13:53
horloge detection
from imutils.perspective import four_point_transform
from imutils import contours
import imutils
import cv2
# defining dictionary of digits
# defined in the form of segment display (led digit display)
# https://www.pyimagesearch.com/wp-content/uploads/2017/02/digit_reco_template.png
DIGITS = {
(1, 1, 1, 0, 1, 1, 1) : 0,
@ibrandiay
ibrandiay / opencv_qt_label.md
Created July 9, 2021 17:59 — forked from docPhil99/opencv_qt_label.md
How to display opencv video in pyqt apps

The code for this tutorial is here

Opencv provides are useful, but limited, method of building a GUI. A much more complete system could be acheived using pyqt. The question is, how do we display images. There are quite a few possible routes but perhaps the easiest is to use QLabel since it has a setPixmap function. Below is some code that creates two labels. It then creates a grey pixmap and displays it one of the labels. code: staticLabel1.py

from PyQt5.QtWidgets import QWidget, QApplication, QLabel, QVBoxLayout
from PyQt5.QtGui import QPixmap, QColor
import sys
@ibrandiay
ibrandiay / Revert sublime text 3 to a fresh state.md
Created July 2, 2021 08:11 — forked from math2001/Revert sublime text 3 to a fresh state.md
Revert Sublime Text 3 to a fresh state step by step 🙂

[UPDATE] Sublime Text 4

If you have the latest sublime text (version 4), you can just do:

subl --safe-mode

How do I revert Sublime Text 3 to a fresh state

@ibrandiay
ibrandiay / teste.py
Last active June 9, 2021 15:06
Tests if the .txt files which are in the current directory are empty or not, in which case they will be deleted.This is very useful for checking the labels in .txt (yolo) format, and if the labels are empty, remove both the labels and the corresponding image (decommission line 11 to remove the images)
import os
import glob
files = glob.glob(os.path.join ('*.txt'))
for file in files:
filesize = os.path.getsize(file)
if filesize == 0:
os.remove(file)
@ibrandiay
ibrandiay / convert_voc_to_yolo.md
Created May 6, 2021 09:46 — forked from Amir22010/convert_voc_to_yolo.md
convert pascal voc dataset to yolo format

Convert PascalVOC Annotations to YOLO

This script reads PascalVOC xml files, and converts them to YOLO txt files.

Note: This script was written and tested on Ubuntu. YMMV on other OS's.

Disclaimer: This code is a modified version of Joseph Redmon's voc_label.py

Instructions:

  1. Place the convert_voc_to_yolo.py file into your data folder.
@ibrandiay
ibrandiay / AwesomeCourses.md
Created March 6, 2021 14:15 — forked from Amir22010/AwesomeCourses.md
List of awesome university courses for learning Computer Science!

Awesome Courses Awesome

Introduction

There is a lot of hidden treasure lying within university pages scattered across the internet. This list is an attempt to bring to light those awesome courses which make their high-quality material i.e. assignments, lectures, notes, readings & examinations available online for free.

Table of Contents