Skip to content

Instantly share code, notes, and snippets.

@yinguobing
yinguobing / process_video.py
Last active August 26, 2022 01:39
Template module for video frame processing.
"""Template code for video frame processing.
Features:
- video source from files or webcams.
- automatically flip the frame if reading from webcam.
- built in video writer to output the processed result.
- built in FPS metter.
For more: https://github.com/yinguobing
"""
@YashasSamaga
YashasSamaga / yolov4.py
Last active July 13, 2024 06:42
YOLOv4 on OpenCV DNN
import cv2
import time
CONFIDENCE_THRESHOLD = 0.2
NMS_THRESHOLD = 0.4
COLORS = [(0, 255, 255), (255, 255, 0), (0, 255, 0), (255, 0, 0)]
class_names = []
with open("classes.txt", "r") as f:
class_names = [cname.strip() for cname in f.readlines()]
@jpwiedekopf
jpwiedekopf / cross_stitch.py
Created October 5, 2019 21:48
CrossStitch (from Misra et al 2016, arXiv:1604.03539) in tf.keras (Tensorflow 2)
import tensorflow as tf
class CrossStitch(tf.keras.layers.Layer):
"""Cross-Stitch implementation according to arXiv:1604.03539
Implementation adapted from https://github.com/helloyide/Cross-stitch-Networks-for-Multi-task-Learning"""
def __init__(self, num_tasks, *args, **kwargs):
"""initialize class variables"""
@pknowledge
pknowledge / text_file_to_speech.py
Created September 10, 2019 20:57
TEXT TO SPEECH IN PYTHON | Convert Text to Speech in Python
# Import the Gtts module for text
# to speech conversion
from gtts import gTTS
# import Os module to start the audio file
import os
fh = open("test.txt", "r")
myText = fh.read().replace("\n", " ")
@bradtraversy
bradtraversy / django_crash_course.MD
Last active November 16, 2024 08:39
Commands for Django 2.x Crash Course

Django Crash Course Commands

# Install pipenv
pip install pipenv
# Create Venv
pipenv shell
@JerryLokjianming
JerryLokjianming / Crack Sublime Text Windows and Linux.md
Last active November 19, 2024 12:13
Crack Sublime Text 3.2.2 Build 3211 and Sublime Text 4 Alpha 4098 with Hex

How to Crack Sublime Text 3.2.2 Build 3211 with Hex Editor (Windows | Without License) ↓

  1. Download & Install Sublime Text 3.2.2 Build 3211
  2. Visit https://hexed.it/
  3. Open file select sublime_text.exe
  4. Offset 0x8545: Original 84 -> 85
  5. Offset 0x08FF19: Original 75 -> EB
  6. Offset 0x1932C7: Original 75 -> 74 (remove UNREGISTERED in title bar, so no need to use a license)
@CraftingGamerTom
CraftingGamerTom / Learn Git Branching.md
Last active October 3, 2024 08:05
learn-git-branching-solution learn-git-branching-main learn-git-branching-remote learn git branching solution learn git branching main learn git branching remote

Learning Git Branching

Please do not continue if you have not learned the content covered in these assignments. It is important to learn the material. However if, like me, you find yourself needing to complete arbitrary tasks for classes you are capable of testing out of - but its not offered. Please continue...

README: To use this quickly, copy and paste the entire block of code in the 'console' using CTRL-V. They have been written so you do not need to copy each line, one-by-one

Main

1.1 Introduction to Git Commits

@matteocrippa
matteocrippa / flutter.md
Last active September 20, 2024 13:10
Flutter Cheatsheet

Flutter

A quick cheatsheet of useful snippet for Flutter

Widget

A widget is the basic type of controller in Flutter Material. There are two type of basic Widget we can extend our classes: StatefulWidget or StatelessWidget.

Stateful

StatefulWidget are all the widget that interally have a dynamic value that can change during usage. It can receive an input value in the constructor or reference to functions. You need to create two classes like:

@sibelius
sibelius / learning.md
Last active August 23, 2023 13:21
Learning Path React Native

Basics

  • Learn how to start a new react native project
  • Run it on ios simulator, on android emulator, on a real iPhone device and on a real Android device, with and without debugging enabled.
  • Learn how to upgrade a react native project
  • Learn how to add a package to the project
  • Learn how to add a package that has a native dependency (https://github.com/airbnb/react-native-maps, https://github.com/evollu/react-native-fcm) - DO NOT USE COCOAPODS
  • Learn how to use fetch to get data from your backend

Learn Navigation

@wojteklu
wojteklu / clean_code.md
Last active November 20, 2024 00:25
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules