Skip to content

Instantly share code, notes, and snippets.

View kunalgoyal9's full-sized avatar
:bowtie:

Kunal Goyal kunalgoyal9

:bowtie:
  • India, Delhi
View GitHub Profile
import plotly.graph_objects as go
# Create the figure
fig = go.Figure()
# Add the text annotation
annotation = go.layout.Annotation(
x=-0.047,
y=1.025,
xref="paper",
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
@kunalgoyal9
kunalgoyal9 / Slack_send_message.py
Created December 23, 2021 07:13
This gist takes any parameters as message and sends to the channel
import requests
import sys
import getopt
def send_slack_message(message):
payload = '{"text": "%s"}' % message
response = requests.post("https://hooks.slack.com/services/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",
data = payload)
print(response.text)
@kunalgoyal9
kunalgoyal9 / categorized_single_vs_double_lps.py
Last active March 12, 2021 05:34
Get area code from LP
class Point:
def __init__(self, x, y):
self.x = x
self.y = y
def onSegment(p, q, r):
if ( (q.x <= max(p.x, r.x)) and (q.x >= min(p.x, r.x)) and(q.y <= max(p.y, r.y)) and (q.y >= min(p.y, r.y))):
return True
return False
import cv2
import os
frames_path = "/home/kunal/Vehicle_detection_tflite/Data-dashboard-Frames"
videos_path = "/home/kunal/Vehicle_detection_tflite/Data-dashboard"
videos = os.listdir(videos_path)
idx = 0
for video in videos:
path = os.path.join(videos_path, video)
@kunalgoyal9
kunalgoyal9 / Slow_fast_int8.py
Last active July 4, 2020 13:00
File to run Slow fast architecture for int 8 calibration
#
# Copyright 1993-2019 NVIDIA Corporation. All rights reserved.
#
# NOTICE TO LICENSEE:
#
# This source code and/or documentation ("Licensed Deliverables") are
# subject to NVIDIA intellectual property rights under U.S. and
# international Copyright laws.
#
# These Licensed Deliverables contained herein is PROPRIETARY and
@kunalgoyal9
kunalgoyal9 / calibrator.py
Created July 4, 2020 12:54
Calibration of Slowfast architecture on UCF101 dataset
import pycuda.driver as cuda
import pycuda.autoinit
import numpy as np
from PIL import Image
import ctypes
import tensorrt as trt
from slowfast.config.defaults import get_cfg
from slowfast.datasets import loader