Skip to content

Instantly share code, notes, and snippets.

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


On a Playground of coding
View GitHub Profile
MeAmarP /
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."""
doc =
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
path_to_model_weight = "yolov2-voc.weights"