Skip to content

Instantly share code, notes, and snippets.

View AsharFatmi's full-sized avatar
🤔
In the Zone

Ashar Fatmi AsharFatmi

🤔
In the Zone
  • Kellogg School of Mangement
  • Chicago, USA
View GitHub Profile
click==7.1.2
gurobipy==9.1.2
itsdangerous==1.1.0
Jinja2==2.11.3
llist==0.8
MarkupSafe==1.1.1
natsort==7.1.1
numpy==1.19.5
orderedset==2.0.3
pkg-resources==0.0.0
import logging
def logInfoDetils(info):
logging.basicConfig(
format='%(asctime)s -- {%(levelname)s} ==> %(message)s', level=logging.INFO)
logging.info(info)
pass
from itertools import cycle
from shutil import get_terminal_size
from threading import Thread
from time import sleep
class Loader:
def __init__(self, desc="Loading...", end="Done!", timeout=0.1):
"""
A loader-like context manager
@AsharFatmi
AsharFatmi / trt_run_inference.py
Last active December 4, 2020 08:10
trt wpodnet lp detection inference file
import numpy as np
from PIL import Image
import cv2
from src.keras_utils import reconstruct
import pycuda.driver as cuda
import pycuda.autoinit # For automatic creation and cleanup of CUDA context
import tensorrt as trt
import utils
@AsharFatmi
AsharFatmi / run_wpod_keras.py
Created February 18, 2020 05:48
wpodnet lp detector
import numpy as np
import cv2
import time
from os.path import splitext
from src.label import Label
from src.utils import getWH, nms
from src.projection_utils import getRectPts, find_T_matrix
@AsharFatmi
AsharFatmi / onnx_to_trt.py
Created February 17, 2020 11:52
convert onnx to trt engine
#!/usr/bin/env python3
# Copyright 2019 NVIDIA Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@AsharFatmi
AsharFatmi / record_video.py
Created October 7, 2019 07:00
Python script to record video from camera without cv2.imshow. to stop recording just hit ctrl+c .
import numpy as np
import cv2
cap = cv2.VideoCapture(0) # for IPCamera format : rtsp://admin:admin@192.168.10.122:554/1
# Define the codec and create VideoWriter object
fourcc = cv2.VideoWriter_fourcc(*'mp4v')
out = cv2.VideoWriter('traffic_video_back.mp4',fourcc, 15.0, (1920,1080))
frame_count = 0
while(cap.isOpened()):