Skip to content

Instantly share code, notes, and snippets.

View Outsiders17711's full-sized avatar

Oluwaleke Umar Yusuf Outsiders17711

View GitHub Profile
@Outsiders17711
Outsiders17711 / accelerate_lr_find_1.py
Last active June 15, 2022 09:16
Testing fastai's lr_find with accelerate.
from fastai.vision.all import *
from fastai.distributed import *
from fastai.vision.models.xresnet import *
path = rank0_first(untar_data, URLs.PETS)
def get_y(o): return o[0].isupper()
dls = ImageDataLoaders.from_name_func(
path=path,
fnames=get_image_files(path),
@Outsiders17711
Outsiders17711 / virtualZoomGesture.py
Last active September 6, 2021 06:07
This code below fixes the bug where the program crashes if the zoomed image moves out of the webcam image's bounds. The zoomed image slice is updated to show the visible part.
# %%
# [Virtual Zoom Gesture using OpenCV Python | CVZone](https://www.youtube.com/watch?v=VPaFV3QBsEw)
# --- Murtaza Hassan ---
# Code & Resources: n/a
# %%
# [start]____________________________________________________________
import cv2 as cv
from cvzone.HandTrackingModule import HandDetector
@Outsiders17711
Outsiders17711 / multi_selectbox.py
Created August 27, 2021 12:49
A simple Streamlit form that provides three sets options using selectboxes limited to one choice in total.
import streamlit as st
blank_choice = "<----->"
options = [
[
blank_choice,
"Option 1",
"Option 2",
"Option 3",
],
@Outsiders17711
Outsiders17711 / multi_checkboxes.py
Last active August 27, 2021 12:45
A simple Streamlit form that provides three options using checkboxes.
import streamlit as st
import time
form = st.sidebar.form("form", clear_on_submit=True)
with form:
form.write("**`Choose a box :`**")
tick_boxes = form.columns(3)
col_labels = [col.write(f"`Option {idx + 1}`") for idx, col in enumerate(tick_boxes)]
values = [
col.checkbox(f"{idx + 1}", key=f"{idx+1}", value=False)
@Outsiders17711
Outsiders17711 / simple_hangman.py
Created August 26, 2021 22:17
Simple Hangman App Using Streamlit
import streamlit as st
import string
import time
import dataclasses
# [start] [persistent states]__________________________________________
@dataclasses.dataclass
class gameState:
# HangMan
hm_word: str = ""