Skip to content

Instantly share code, notes, and snippets.

View mirfan899's full-sized avatar
🏠
Working from home

Muhammad Irfan mirfan899

🏠
Working from home
View GitHub Profile
@mirfan899
mirfan899 / xml_split.py
Created October 27, 2022 07:09 — forked from scnctech/xml_split.py
I took this gist https://gist.github.com/benallard/8042835 and modified it a little so it worked for my needs. (mainly encoding issues and bigger file chunks)
#!/usr/bin/env python
#based off this gist https://gist.github.com/benallard/8042835
#modified it a little so it worked for my needs. (mainly encoding issues and bigger file chunks)
import os
import xml.parsers.expat
from xml.sax.saxutils import escape
from optparse import OptionParser
from math import log10
@mirfan899
mirfan899 / xml_split.py
Created October 27, 2022 07:09 — forked from benallard/xml_split.py
Small python script to split huge XML files into parts. It takes one or two parameters. The first is always the huge XML file, and the second the size of the wished chunks in Kb (default to 1Mb) (0 spilt wherever possible) The generated files are called like the original one with an index between the filename and the extension like that: bigxml.…
#!/usr/bin/env python
import os
import xml.parsers.expat
from xml.sax.saxutils import escape
from optparse import OptionParser
from math import log10
# How much data we process at a time
@mirfan899
mirfan899 / detect_crop.py
Created November 9, 2022 10:17 — forked from mcclux/detect_crop.py
Python script using dlib to detect and save faces from a set of source images
import os
import sys
import dlib
import matplotlib.pyplot as plt
from PIL import Image
# adjust these variables as necessary
# dirname is the directory relative to the script where the files to detect a face and crop live
dirname = "source"