Skip to content

Instantly share code, notes, and snippets.

View Coderx7's full-sized avatar
💭
In God we Trust!

Seyyed Hossein Hasanpour Coderx7

💭
In God we Trust!
  • IRAN
  • 03:47 (UTC +03:30)
View GitHub Profile
@Coderx7
Coderx7 / embpython.c
Created April 20, 2020 07:48 — forked from bluebanboom/embpython.c
Example of embedding python in c.
#include <Python.h>
#include <stdio.h>
/*
* gcc embpython.c -I/usr/include/python2.7 -lpython
**/
void loadModule()
{
/* run objects with low-level calls */
char *arg1="sir", *arg2="robin", *cstr;
printf("Load Module err!\n");
@Coderx7
Coderx7 / test.c
Created April 20, 2020 07:48 — forked from nad2000/test.c
Basic examples to show how to embed and extend Python in C including: creation of module in C with functions handling and building Python objects; importing and calling python functions from C.
/* Example of embedding Python in another program */
// to compile run:
// gcc -o test $(python-config --cflags) test.c $(python-config --ldflags) && ./test
#include<stdio.h>
#include "Python.h"
void initxyzzy(void); /* Forward */
main(int argc, char **argv)
@Coderx7
Coderx7 / cifar10-normalize.py
Created January 12, 2017 18:30
CIfar10-lmdb-zeropad-normalize script for caffe
#in the name of God, the most compassionate the most merciful
#Seyyed Hossein Hasanpour
#Coderx7@Gmail.com
#script for zeropadding and normalizing CIFAR10 dataset (can also be used for CIFAR100)
import math
import caffe
import lmdb
import numpy as np
from caffe.proto import caffe_pb2
import cv2
@Coderx7
Coderx7 / binaryprotoTonpy.py
Last active January 1, 2020 09:28
A script for converting Caffe's binaryproto mean file to npy format
#In the name of God
#Use this script to convert a binaryproto mean file to an equivalent python npy mean file.
#simply use the script like this :
#python convert_protomean.py mean.binaryproto mean.npy"
import caffe
import numpy as np
import sys
if len(sys.argv) != 3:
print "Usage: python convert_protomean.py mean.binaryproto mean.npy"
@Coderx7
Coderx7 / confusionMatrix_convnet_test_BatchMode(VeryFast).py
Last active September 3, 2019 08:22
Caffe confusion matrix, precision and recall and F1 Score script!
#in the name of God the most compassionate the most merciful
# added mean subtraction so that, the accuracy can be reported accurately just like caffe when doing a mean subtraction
# Seyyed Hossein Hasan Pour
# Coderx7@Gmail.com
# 7/3/2016
# Added Recall/Precision/F1-Score as well
# 01/03/2017
# Added batch processing, not what used to take a minute or so, takes only several seconds!
# 07/25/2017
#info:
@Coderx7
Coderx7 / -1559928795563.log
Created June 7, 2019 17:35
vscode console log with default jedi
workbench.main.js:3313 [Extension Host] debugger listening on port 36301
workbench.main.js:238 [Extension Host] [vscode-icons] v8.7.0 activated!
workbench.main.js:238 [Extension Host] (node:12808) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
t.log @ workbench.main.js:238
workbench.main.js:238 [Extension Host] Info Python Extension: 2019-06-07 22:02:44: Display locator refreshing progress, Class name = p, completed in 1ms, , Return Value: undefined
workbench.main.js:238 [Extension Host] Info Python Extension: 2019-06-07 22:02:44: Notify locators are locating, Class name = p, completed in 1ms, , Return Value: undefined
workbench.main.js:238 [Extension Host] Info Python Extension: 2019-06-07 22:02:44: Checking whether locactors have completed locating, Class name = p, completed in 0ms, , Return Value: false
workbench.main.js:238 [Extension Host] Info Python Extension: 2019-06-07 22
@Coderx7
Coderx7 / vscode_console_log.log
Created June 7, 2019 17:29
vscode console log2(jedi related)
workbench.main.js:3313 [Extension Host] debugger listening on port 41068
workbench.main.js:3311 Extension Host
workbench.main.js:3311 Debugger listening on ws://127.0.0.1:41068/e4a995f0-d848-45d7-836c-3acdce098a58
For help, see: https://nodejs.org/en/docs/inspector
workbench.main.js:238 [Extension Host] (node:22448) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
t.log @ workbench.main.js:238
workbench.main.js:238 [Extension Host] [vscode-icons] v8.7.0 activated!
workbench.main.js:238 [Extension Host] Info Python Extension: 2019-06-07 21:52:01: Display locator refreshing progress, Class name = p, completed in 1ms, , Return Value: undefined
workbench.main.js:238 [Extension Host] Info Python Extension: 2019-06-07 21:52:01: Notify locators are locating, Class name = p, completed in 2ms, , Return Value: undefined
@Coderx7
Coderx7 / -1559596165831.log
Created June 3, 2019 21:12
vscode console log
workbench.main.js:3272 [Extension Host] debugger listening on port 16367
workbench.main.js:3270 Extension Host
workbench.main.js:3270 Debugger listening on ws://127.0.0.1:16367/d86fbd32-94fb-45fe-a384-4880d4073811
For help, see: https://nodejs.org/en/docs/inspector
workbench.main.js:238 [Extension Host] [vscode-icons] v8.7.0 activated!
workbench.main.js:238 [Extension Host] (node:8044) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
t.log @ workbench.main.js:238
workbench.main.js:238 [Extension Host] Info Python Extension: 2019-06-04 01:29:01: Display locator refreshing progress, Class name = p, completed in 1ms, , Return Value: undefined
workbench.main.js:238 [Extension Host] Info Python Extension: 2019-06-04 01:29:01: Notify locators are locating, Class name = p, completed in 2ms, , Return Value: undefined
@Coderx7
Coderx7 / Caffe_Convnet_ConfuxionMatrix.py
Last active November 19, 2018 10:02 — forked from axel-angel/convnet_test.py
Caffe script to compute accuracy and confusion matrix, Added mean subtraction. it now accurately reports the accuracy (just like caffe)
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Author: Axel Angel, copyright 2015, license GPLv3.
# added mean subtraction so that, the accuracy can be reported accurately just like caffe when doing a mean subtraction
# Seyyed Hossein Hasan Pour
# Coderx7@Gmail.com
# 7/3/2016
import sys
@Coderx7
Coderx7 / CaffePlot.py
Created June 6, 2016 04:10
a plot script for caffe to show loss/training curves
# In the name of GOD the most compassionate the most merciful
# Originally developed by Yasse Souri
# Just added the search for current directory so that users dont have to use command prompts anymore!
# and also shows the top 4 accuracies achieved so far, and displaying the highest in the plot title
# Coded By: Seyyed Hossein Hasan Pour (Coderx7@gmail.com)
# -------How to Use ---------------
# 1.Just place your caffe's traning/test log file (with .log extension) next to this script
# and then run the script.If you have multiple logs placed next to the script, it will plot all of them
# you may also copy this script to your working directory, where you generate/keep your train/test logs
# and easily execute the script and see the curve plotted.