<commit_before># Slightly adapted by <NAME> (<EMAIL>) based on work of GitHub user shahriman
# Original at:
# https://gist.github.com/shahriman/3289170
""" This is an implementation of the paper found here: http://www.cs.cmu.edu/~htong/pdf/ICME04_tong.pdf """

"""
Requirements:
Pillow - http://pillow.readthedocs.org
PyWavelets - http://www.pybytes.com/pywavelets/
NumPy - http://www.numpy.org

"""

# Modified to use Pillow
from PIL import Image
import numpy
import pywt
import sys

thresh = 35
#MinZero = 0.05
# larger numbers are more sensitive to blur detection
MinZero = 0.07

print(sys.argv[1])
im=Image.open(sys.argv[1]).convert('F')
x=numpy.asarray(im)
x_cropped=x[0:(numpy.shape(x)[0]/16)*16 - 1,0:(numpy.shape(x)[1]/16)*16 - 1]
LL1,(LH1,HL1,HH1)=pywt.dwt2(x_cropped,'haar')
LL2,(LH2,HL2,HH2)=pywt.dwt2(LL1      ,'haar')<commit_msg>added info about another implementation<commit_after># Slightly adapted by <NAME> (<EMAIL>) based on work of GitHub user shahriman
# Original at:
# https://gist.github.com/shahriman/3289170
"""
Another adaption is at https://github.com/chihsuan/detect-blurry-video/blob/master/detect_blurry_image.py
The original at https://gist.github.com/shahriman/3289170 is no longer available.
"""
""" This is an implementation of the paper found here: http://www.cs.cmu.edu/~htong/pdf/ICME04_tong.pdf """

"""
Requirements:
Pillow - http://pillow.readthedocs.org
PyWavelets - http://www.pybytes.com/pywavelets/
NumPy - http://www.numpy.org

"""

# Modified to use Pillow
from PIL import Image
import numpy
import pywt
import sys

thresh = 35
#MinZero = 0.05
# larger numbers are more sensitive to blur detection
MinZero = 0.07

print(sys.argv[1])
im=Image.open(sys.argv[1]).convert('F')
x=numpy.asarray(im)
x_cropped=x[0:(numpy.shape(x)[0]/16)*16 - 1,0:(numpy.shape(x)[1]/16)*16 - 1]
LL1,(LH1,HL1,HH1)=pywt.dwt2(x_cropped,'haar')
LL2,(LH2,HL2,HH2)=pywt.dwt2(LL1      ,'haar')
{'fraction_non_alphanumeric': 0.16474291710388247, 'fraction_numerical': 0.049842602308499476, 'mean_word_length': 4.922360248447205, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7368890', 'n_tokens_mistral': 814, 'n_tokens_neox': 746, 'n_words': 156}