Skip to content

Instantly share code, notes, and snippets.

View MeAmarP's full-sized avatar
👨‍💻
On a Playground of coding

AMAR POTDAR MeAmarP

👨‍💻
On a Playground of coding
View GitHub Profile
@MeAmarP
MeAmarP / pdf_extract.py
Created February 28, 2024 18:12
extract pdf content page wise into json
import fitz
import json
def open_pdf_document(path):
"""Open a PDF document and return the document object."""
try:
doc = fitz.open(path)
return doc
except Exception as e:
print(f"Failed to open document: {e}")
import argparse
import glob
import numpy as np
import cv2
# NOTE - This gist only to test Yolov2 model and New OpenCV DNN API
# https://pjreddie.com/darknet/yolov2/
path_to_model_weight = "yolov2-voc.weights"