Skip to content

Instantly share code, notes, and snippets.

View ahmedbilal's full-sized avatar

Ahmed Bilal Khalid ahmedbilal

  • 40grid
  • Lahore, Pakistan
View GitHub Profile
@ahmedbilal
ahmedbilal / imaginary_time.py
Created December 8, 2023 10:33
Creating recurring dates from aware datetime results in imaginary time
from datetime import datetime
from zoneinfo import ZoneInfo
from dateutil import tz
from dateutil.rrule import rrule, SA, SU, DAILY
start_date = datetime(2023, 3, 4, 2, 10, tzinfo=ZoneInfo("America/New_York"))
for dt in rrule(freq=DAILY, count=10, byweekday=[SA, SU], dtstart=start_date):
print(dt, tz.datetime_exists(dt))
@ahmedbilal
ahmedbilal / django-paint-points.txt
Last active August 11, 2023 14:22
Django Pain Points
Print SQL Queries in Jupyterlab
Connect Jupyter lab with Django Extensions Kernel
@ahmedbilal
ahmedbilal / API.md
Last active May 17, 2023 09:05 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

Method & URL

GET | POST | DELETE | PUT <The URL Structure (path only, no root url)>

<For Example: POST /api/search/fastsearch/>

0
0
0
0
0
0
0
0
0
0
This file has been truncated, but you can view the full file.
0,9,0,0,0,0,0,9,0,0,0,0,0,9,0,0,0,0,0,9,0,0,0,0,0,30,0,0,0,0
0,9,0,0,0,0,0,9,0,0,0,0,0,9,0,0,0,0,0,9,0,0,0,0,0,30,0,0,0,0
0,9,0,0,0,0,0,9,0,0,0,0,0,9,0,0,0,0,0,9,0,0,0,0,0,30,0,0,0,0
0,9,0,0,0,0,0,9,0,0,0,0,0,9,0,0,0,0,0,9,0,0,0,0,0,30,0,0,0,0
0,9,0,0,0,0,0,9,0,0,0,0,0,9,0,0,0,0,0,9,0,0,0,0,0,30,0,0,0,0
0,9,0,0,0,0,0,9,0,0,0,0,0,9,0,0,0,0,0,9,0,0,0,0,0,30,0,0,0,0
0,9,0,0,0,0,0,9,0,0,0,0,0,9,0,0,0,0,0,9,0,0,0,0,0,30,0,0,0,0
0,9,0,0,0,0,0,9,0,0,0,0,0,9,0,0,0,0,0,9,0,0,0,0,0,30,0,0,0,0
0,9,0,0,0,0,0,9,0,0,0,0,0,9,0,0,0,0,0,9,0,0,0,0,0,30,0,0,0,0
0,9,0,0,0,0,0,9,0,0,0,0,0,9,0,0,0,0,0,9,0,0,0,0,0,30,0,0,0,0
import keras
import numpy as np
from os.path import isfile as is_file_exists
from keras.models import Sequential
from keras.layers import Dense, Activation
from keras.optimizers import Adam
from sklearn.preprocessing import MinMaxScaler
from sklearn.model_selection import train_test_split
{
"embeddings": [
{
"tensorName": "My tensor",
"tensorShape": [
1000,
50
],
"tensorPath": "https://gist.githubusercontent.com/ahmedbilal/5d9804d5821dd7ef634d67d27d69a211/raw/aa197ef9f61f0fb304e23e8165bbfc6171c31043/X_Values.tsv",
"metadataPath": "https://gist.githubusercontent.com/ahmedbilal/5d9804d5821dd7ef634d67d27d69a211/raw/aa197ef9f61f0fb304e23e8165bbfc6171c31043/labels.tsv"
368 348 0 0 0 0
735 304 178 0 0 0
1066 500 0 0 0 0
609 216 0 116 0 0
256 332 122 105 0 0
772 105 55 0 0 0
439 175 0 0 0 0
606 163 0 0 0 0
723 428 0 37 0 0
436 107 0 0 0 0
@ahmedbilal
ahmedbilal / verify_annotation.py
Created March 12, 2019 20:20
Verify annotation[.txt] obtained from cvat_xml_to_txt.py
import cv2
import os
import argparse
arg_parser = argparse.ArgumentParser()
arg_parser.add_argument("--input", type=str, help="Input annotation[.txt] file path",
dest="input_file", required=True)
args = arg_parser.parse_args()
with open(args.input_file, "r") as f:
@ahmedbilal
ahmedbilal / filter_annotation.py
Created March 12, 2019 20:19
Filter annotation[.txt] file created using cvat_xml_to_txt.py
import argparse
from collections import namedtuple
ROI = namedtuple("ROI", ["xa", "ya", "xb", "yb"])
arg_parser = argparse.ArgumentParser()
arg_parser.add_argument("--input", type=str, help="Input annotation[.txt] file path", dest="input_file",
required=True)
arg_parser.add_argument("--output", type=str, help="Output/Filtered annotation[.txt] file path",
dest="output_file", required=True)