# Install pipenv
pip install pipenv
# Create Venv
pipenv shell
"""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 | |
""" |
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()] |
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""" |
# 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", " ") |
0x8545
: Original 84
-> 85
0x08FF19
: Original 75
-> EB
0x1932C7
: Original 75
-> 74
(remove UNREGISTERED in title bar, so no need to use a license)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
A quick cheatsheet of useful snippet for Flutter
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
.
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:
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.