Skip to content

Instantly share code, notes, and snippets.

View mahamatnoumai's full-sized avatar
🎯
Focusing

Ali mahamatnoumai

🎯
Focusing
View GitHub Profile
@jaysridhar
jaysridhar / ImageBatchConverter.py
Created March 23, 2021 10:14
Python Pillow example code for batch conversion of image files in a directory from one format (PNG, JPG, GIF, etc) to another.
#!/usr/bin/python
import argparse, glob, os
from PIL import Image
formats = ["BMP", "DIB", "EPS", "GIF", "ICNS", "ICO", "IM", "JPG", "JPEG",
"J2K", "J2P", "JPX", "MSP", "PCX", "PNG", "PPM", "SGI",
"SPIDER", "TGA", "TIFF", "WebP", "XBM"]
parser = argparse.ArgumentParser(description="Pillow example - batch converter.")
parser.add_argument('-outdir', default='.', help='Directory to save converted image files')
@shahdghorsi
shahdghorsi / TFLiteObjectDetectionAPIModel.java
Last active April 30, 2021 09:59
Solving the array out of bound error
- recognitions.add(
- new Recognition(
- "" + i,
- labels.get((int) outputClasses[0][i] + labelOffset),
- outputScores[0][i],
- detection));
+ final int classLabel = (int) outputClasses[0][i] + labelOffset;
+ if (inRange(classLabel, labels.size(), 0) && inRange(outputScores[0][i], 1, 0)) {
+ recognitions.add(
+ new Recognition(
@apivovarov
apivovarov / to_tflite.py
Created June 13, 2019 01:31
Convert to tflite format
#!/usr/bin/env python3
import tensorflow.lite as lite
from tensorflow.lite.python import lite_constants
import sys
# Converting a GraphDef from file.
def from_frozen_graph(graph_def_file):
input_arrays = ["normalized_input_image_tensor"]
@apivovarov
apivovarov / convert_tf_ssd_to_tflite.md
Last active January 19, 2023 13:44
Convert Tensorflow SSD models to TFLite format
@cketti
cketti / android-28-sources.md
Created August 7, 2018 16:21
Build your own android-28 sources

Build "Sources for Android 28" so you can comfortably browse the Android API source in Android Studio.

  1. Collect source files
mkdir android-sdk-source-build
cd android-sdk-source-build

mkdir -p frameworks/base
@toransahu
toransahu / models.py
Last active May 5, 2023 14:04
Writable Nested Serializers | Multiple Images Upload | DRF
#!/usr/bin/env python3.6.4
# coding="UTF-8"
__author__ = 'Toran Sahu <toran.sahu@yahoo.com>'
__copyright__ = 'Copyright (C) 2018 Ethereal Machines Pvt. Ltd. All rights reserved'
from django.db import models
from os import path
from utils import directory_path_with_id
@tarlen5
tarlen5 / calculate_mean_ap.py
Last active April 20, 2024 05:19
Calculate mean Average Precision (mAP) for a set of ground truth and predicted bounding boxes for a set of images.
"""
author: Timothy C. Arlen
date: 28 Feb 2018
Calculate Mean Average Precision (mAP) for a set of bounding boxes corresponding to specific
image Ids. Usage:
> python calculate_mean_ap.py
Will display a plot of precision vs recall curves at 10 distinct IoU thresholds as well as output
@WebRTCGame
WebRTCGame / JavascriptBooks.md
Last active April 10, 2024 01:44
Free Javascript Books

Useful Links

23 Free JavaScript Books

A curated collection of awesome & free JavaScript books to help you learn the JavaScript programming language.

If you know of any other free JavaScript books that you think should be on this list, please let me know in the comments section and I will get them added.

@rubenlagus
rubenlagus / Main.java
Last active May 31, 2021 13:22
Example of sending a SendMessage method using Telegram API with ReplyMarkupKeyboard
package org.telegram.example.SendMessage;
import org.apache.http.NameValuePair;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONArray;
import org.json.JSONObject;
import java.io.IOException;
@dwchiang
dwchiang / .zshrc
Created April 16, 2014 10:30
gcloud with zsh
# The next line updates PATH for the Google Cloud SDK.
source /Users/dwchiang/google-cloud-sdk/path.zsh.inc
# The next line enables zsh completion for gcloud.
source /Users/dwchiang/google-cloud-sdk/completion.zsh.inc