Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
Commit type | Emoji |
---|---|
Initial commit | 🎉 :tada: |
Version tag | 🔖 :bookmark: |
New feature | ✨ :sparkles: |
Bugfix | 🐛 :bug: |
# save this file as postQuantization.py | |
def representative_dataset(): | |
for _ in range(100): | |
data = np.random.rand(1, 320, 320, 3) | |
yield [data.astype(np.float32)] | |
import numpy as np | |
import tensorflow as tf | |
saved_model_dir = "output/exported_models/tflite_infernce/saved_model" |
''' Writing MetaData to TfLite Model | |
save it as MetaDataWriterFile.py''' | |
from tflite_support.metadata_writers import object_detector | |
from tflite_support.metadata_writers import writer_utils | |
from tflite_support import metadata | |
ObjectDetectorWriter = object_detector.MetadataWriter | |
_MODEL_PATH = <tf_lite_model_path> | |
_LABEL_FILE = <label_path> |
from PIL import Image | |
import pytesseract | |
pytesseract.pytesseract.tesseract_cmd = r"path_to_tessract.exe" | |
def ocr(filename): | |
img = Image.open(filename) | |
text = pytesseract.image_to_string(img) | |
return text |
# Send discord message using webhook and asynchronous api with aiohttp and asyncio | |
# Asynchronous calls do not block (or wait) for the API call to return from the server. | |
# Execution continues on in your program, and when the call returns from the server, a “callback” function is executed. | |
```python | |
import aiohttp | |
import asyncio | |
url = "<your url>" #webhook url, from here: https://i.imgur.com/f9XnAew.png |
''' | |
Script to get GitHub user Data using Asynchronous API, logging and save the output in the SQLite Database. | |
''' | |
import logging | |
import sqlite3 | |
import aiohttp | |
import asyncio | |
from sqlite3 import Error | |
async def fetch_github(url): |
""" python gist to create parser """" | |
import argparse | |
def add(x, y): | |
""" it will return the addition of x and y """ | |
return x + y | |
parser = argparse.ArgumentParser() | |
parser.add_argument('--x', type=int, default=1) |
Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
Commit type | Emoji |
---|---|
Initial commit | 🎉 :tada: |
Version tag | 🔖 :bookmark: |
New feature | ✨ :sparkles: |
Bugfix | 🐛 :bug: |
""" Solver Linear equation using inverse matrix """ | |
import numpy as np | |
class LinearEquationSolver(object): | |
""" Linear Equation solver using inverse matrix | |
equation: AX = B | |
X = inverse(A) . B |
from flask import Flask, jsonify, request | |
# Create a Flask app | |
app = Flask(__name__) | |
# sample superhero data | |
superheroes = [ | |
{ | |
"id": 1, | |
"name": "Superman", | |
"email": "[email protected]", |