Skip to content

Instantly share code, notes, and snippets.

View hrshovon's full-sized avatar

S.M. Hasanur Rashid hrshovon

  • Bangladesh
View GitHub Profile
@hrshovon
hrshovon / savedmodel_simple.py
Created July 25, 2023 00:10
Simple python snippet for downloading a VGG16 model and saving it as savedmodel
import os
os.environ["CUDA_VISIBLE_DEVICES"] = ""
import tensorflow as tf
import tensorflow.keras.backend as K
from pathlib import Path
#leaving this line in case someone needs it, just uncomment the line below and comment the next line
#model = tf.keras.models.load_model(model_path,compile=False)
model = tf.keras.applications.vgg16.VGG16(include_top = True, weights="imagenet", input_shape=(224,224,3))
@hrshovon
hrshovon / build_opencv_ARM_cross
Last active May 21, 2022 17:10
Cross compile opencv3.3.0 for your raspberry pi and similar ARM devices with python support
This is a note on how to cross compile opencv for pretty much any ARM device(HardFP supported in this case) and deploy. Native
compiling in ARM devices can be painfully slow and they seem to hang often during build(mine got stuck at 43%). So if you happen
to have a desktop/laptop/server running ubuntu or similar linux distro, u can build opencv in fractionth of the time taken for
native compiling without any issues.
Building opencv3 with TBB and NEON and VFP support can boost opencv performance. Thanks to Adrian at pyimagesearch for pointing
that out.
Both my PC and target machine aka orange pi zero are running ubuntu 16.04 with python2.7 and python 3.5.
Let us use the term "build machine" for your PC where you are building opencv and "target machine" for the ARM single board computer.
1.Run the following commands in both machines(I think installing these in target machine only would do) to install the necessary libraries etc.(mine worked with them,so they should be enough
@hrshovon
hrshovon / py_faster_rcnn_build.txt
Last active July 15, 2017 16:00
py-faster-rcnn: my attempt of building
This is how I managed to build py-faster-rcnn on my fresh installed 64bit Ubuntu 16.04.For those who dont know, py-faster-rcnn
if a caffe based python implementation of faster-rcnn for image localization. This is more of a note for me.
WARNING: My methods may not work for everyone and may be for the later versions.
This is a GPU supported build. Make sure you have an nvidia gpu(as recent as possible,I have a GTX 1050 Ti, and yes I know
it's by no means a very good gpu for the task.But it handles things nicely.).
Now I am also running Tensorflow-gpu installed via pip. That requires cuda toolkit 8.0 and cudnn 5.1
So,if we are to start from scratch,
1.Download cuda-repo-ubuntu1604-8-0-local-ga2_8.0.61-1_amd64.deb from nvidia website.