Skip to content

Instantly share code, notes, and snippets.

View pebbie's full-sized avatar

Peb Ruswono Aryan pebbie

View GitHub Profile
@pebbie
pebbie / su.py
Last active April 16, 2024 23:42
Implementation of document binarization algorithm by (Bolan Su et al, 2010)
"""
author: Peb Ruswono Aryan
Binarization Algorithm by Su et al.
@inproceedings{Su:2010:BHD:1815330.1815351,
author = {Su, Bolan and Lu, Shijian and Tan, Chew Lim},
title = {Binarization of Historical Document Images Using the Local Maximum and Minimum},
booktitle = {Proceedings of the 9th IAPR International Workshop on Document Analysis Systems},
series = {DAS '10},
@pebbie
pebbie / tiffdump.py
Created July 20, 2018 12:55
hopefully generic TIFF file format extraction tool (GeoTIFF, NEF, ARW)
"""
\description TIFF file format dump
\author paryan
"""
from __future__ import print_function
import argparse
from struct import *
import os
import os.path as path
import os, sys
from lxml import etree
from rdflib import ConjunctiveGraph, Namespace, exceptions
from rdflib import URIRef, RDFS, RDF, OWL, BNode, Literal
def get_tag_no_ns(tname):
if "}" in tname:
return tname[tname.index("}")+1:]
else:
@pebbie
pebbie / metric.py
Last active February 9, 2023 15:22
H-DIBCO evaluation metric
"""
author : Peb Ruswono Aryan
metric for evaluating binarization algorithms
implemented :
* F-Measure
* pseudo F-Measure (as in H-DIBCO 2010 & 2012)
* Peak Signal to Noise Ratio (PSNR)
* Negative Rate Measure (NRM)
@pebbie
pebbie / sparqlqueryviz.py
Last active August 30, 2022 02:53
visualize BGP triples in SPARQL query
import sys
import os.path as path
from rdflib import Namespace, XSD, RDF, RDFS, OWL
from rdflib.term import Variable, URIRef, BNode, Literal
from rdflib.plugins.sparql.parser import parseQuery
from rdflib.plugins.sparql.parserutils import prettify_parsetree
from rdflib.plugins.sparql import prepareQuery
from rdflib.paths import Path
import pprint
import pygraphviz as pgv
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import os
import os.path as path
import sys
import traceback
import json
import zipfile
from urllib.request import urlopen
import shutil
import argparse
@pebbie
pebbie / vis_timeline_with_arror_first_test.html
Created December 17, 2021 11:30 — forked from JimmyCheng/vis_timeline_with_arror_first_test.html
This is test to see how difficult it would be to add multiple arrows to vis.js timeline view. Can be previewed with https://gistpreview.github.io/?4a6a6feba553e2cbe0396486f157b7bb
<!DOCTYPE html>
<html>
<head>
<title>Timeline | Group example, with an arrow</title>
<style>
body,
html {
font-family: arial, sans-serif;
"""
file: rdf2pandas.py
auth: Peb Ruswono Aryan
desc: import data in RDF Data Cube (assumed in particular shape) from Graph to Pandas DataFrame
"""
from rdflib import Graph, Namespace, RDF, RDFS
import pandas as pd
QB = Namespace('http://purl.org/linked-data/cube#')
DCT = Namespace('http://purl.org/dc/terms/')
@pebbie
pebbie / proj4-win64-msvc-2017.md
Last active August 1, 2020 01:12
building proj6 on visual studio 2017 (windows)

Howto build PROJ6 on Windows (Visual Studio 2017-x64)

1. Download SQLITE3

  • build sqlite3.dll :cl sqlite3.c /LD

  • generate sqlite3.lib : lib sqlite3.obj

  • build sqlite3.exe : cl shell.c sqlite3.lib -o sqlite3.exe