<jupyter_start><jupyter_text>Table of Contents<jupyter_code>import scannerpy 
import scannertools as st
import os
from django.db.models import Q
from query.models import Video, VideoTag, Frame
import numpy as np
from esper.prelude import load_frame
import cv2
vids = [vals[0] for vals in VideoTag.objects.values_list('video_id').distinct().all()]
videos = Video.objects.filter(id__in=vids)
len(list(videos))
frames = [[0, 1000]]
db = scannerpy.Database()
brightness = st.imgproc.compute_sharpness(
    db,
    videos=[video.for_scannertools() for video in videos],
    frames=frames,
    cache=False
)
print(list(brightness[0].load()))
brightness_cpp = st.imgproc.compute_sharpness_cpp(
    db,
    videos=[video.for_scannertools() for video in videos],
    frames=frames,
    cache=False
)
print(list(brightness_cpp[0].load()))
brightness_cpp[0]._column._table.profiler().write_trace('brightness_cpp.trace')
contrast = st.imgproc.compute_contrast(
    db,
    videos=[video.for_scannertools() for video in videos],
    frames=frames,
    cache=False
)
sharpness = st.imgproc.compute_sharpness(
    db,
    videos=[video.for_scannertools() for video in videos],
    frames=frames,
    cache=False
)
brightness[0]._column._table.profiler().write_trace('brightness_12_years_full.trace')
contrast[0]._column._table.profiler().write_trace('contrast_12_years_full.trace')
sharpness[0]._column._table.profiler().write_trace('sharpness_12_years_full.trace')
from esper.prelude import Notifier
Notifier().notify('done')
print(list(sharpness[0].load()))
print(flow[0].scanner_source(db))
frame = load_frame(videos[0], 1000, [])
cv2.mean(cv2.pow(cv2.meanStdDev(cv2.Laplacian(frame, cv2.CV_64F))[1], 2))
cv2.meanStdDev(cv2.Laplacian(frame, cv2.CV_64F))[1]
cv2.pow(cv2.meanStdDev(cv2.Laplacian(frame, cv2.CV_64F))[1], 2)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14200217627856365, 'fraction_numerical': 0.02665941240478781, 'mean_word_length': 6.415322580645161, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '116265', 'license': 'Apache-2.0', 'n_tokens_mistral': 711, 'n_tokens_neox': 670, 'n_words': 108, 'path': 'app/notebooks/brightness_film.ipynb', 'repo_name': 'DanFu09/esper', 'size': '1838'}