A small repository of Python utilities for:
- Computer Vision helpers
- Image-Video Processing helpers
- GitHub follower/following snapshots and comparison.
-
custom_utils.py- Defines
imread_custom()for robust image loading with OpenCV from file paths containing non-ASCII characters or long Windows paths.
- Defines
-
CV_IP_Utils/cv_classes.py- Contains Computer Vision & Image-Video Processing utilities and classes:
Filtersfor cartoon, pencil sketch, skin smoothing, sunglasses overlay, face bluring and image/video display.Blemishfor blemish removal using seamless cloning or inpainting.MouseHandlerfor OpenCV mouse-based point selection.DocumentScannerfor document contour detection, perspective correction, and post-processing.Trackerfor YOLO-based detection and OpenCV tracking.
- Contains Computer Vision & Image-Video Processing utilities and classes:
-
GitHub_Utils/followers_check.py- Fetches GitHub followers via the GitHub API and saves usernames to
GitHub_Utils/followers/followersYYYY-MM-DD.json.
- Fetches GitHub followers via the GitHub API and saves usernames to
followings_check.py- Fetches GitHub users you are following and saves usernames to
GitHub_Utils/following/followingYYYY-MM-DD.json.
- Fetches GitHub users you are following and saves usernames to
compare_follow.py- Compares two snapshot JSON files and prints usernames that were added or removed.
followers/andfollowing/- Automatically created directories for stored GitHub snapshot files.
imread_custom()for safer OpenCV image loading from complex file paths.- Filters for images and video frames:
cartooncartoon_stylizedpencilskinsunglassesface_blur
- Blemish removal with seamless clone or inpaint workflows.
- Document scanning with automatic contour detection or manual corner selection.
- YOLO-based ball/object detection with tracker fallback.
- Save followers and following lists as dated JSON snapshots.
- Compare two snapshot files to identify added and removed usernames.
- Supports authenticated API requests via
GITHUB_TOKENin a.envfile.
Here are some example outputs from the various filters applied to sample images:
| Cartoon Filter | Cartoon Stylized Filter |
|---|---|
![]() |
![]() |
| Pencil Sketch Filter | Skin Smoothing Filter |
|---|---|
![]() |
![]() |
| Sunglasses Filter | Sunglasses Filter 1 |
|---|---|
![]() |
![]() |
| Sunglasses Filter 2 | Face Blur Filter |
|---|---|
![]() |
![]() |
Here are some example inputs/outputs from DocumentScanner class
| Raw Photo | Manual Contour Selection |
|---|---|
![]() |
![]() |
| Processed Saved PDF | View PDF |
| Raw Photo | Contour Detection |
|---|---|
![]() |
![]() |
| Processed Saved PDF | View PDF |
- Create a
.envfile at the repository root. - Add your GitHub username and optional token:
GITHUB_USERNAME=your_username
GITHUB_TOKEN=your_token- Run the GitHub scripts:
python GitHub_Utils/followers_check.py
python GitHub_Utils/followings_check.py- Compare two snapshot files:
python GitHub_Utils/python compare_follow.py <2024-01-01> <2024-01-02> [--type followers|following]- Import
imread_customfromcustom_utils:
from custom_utils import imread_custom- Use the
Filtersclass fromCV_IP_Utils/cv_classes.py:
from CV_IP_Utils.cv_classes import Filters
filters = Filters(glasses_path=None, reflection_path=None, source='webcam')
filters.start_filters(filter='cartoon')-
sourcemay be a webcam index,'webcam', a video file path, or an image file path. -
Use
DocumentScannerclass fromCV_IP_Utils/cv_classes.py:
# Initialize the scanner
scanner = DocumentScanner(image_path, manual_selection=False)
# Run the detection and transformation
warped = scanner.run_scanner()
if warped is not None:
# if you want to give it a clean scanned look
final_scan = scanner.post_process_denoise(warped)
# final_scan = wraped
if output_path.lower().endswith('.pdf'):
scanner.save_as_pdf(final_scan, output_path)
- Use
Trackerclass fromCV_IP_Utils/cv_classes.py:
soccer_tracker = Tracker()
bbox, color = soccer_tracker.detect_and_track(frame, class_id=32)
class_idYolov8s has 80 classes, class_id =32 is a sport_ball. To track another class.
tracker = Tracker()
classes = tracker.get_classes()
# track chosen class example
bbox, color = tracker.detect_and_track(frame, class_id=0)
Install the required packages with:
pip install opencv-python numpy requests python-dotenv ultralytics
ultralyticsis only required if you use theTrackerclass incv_classes.pyor face_blur filter inFiltersclass.
custom_utils.pyis a utility module and contains no runnable script logic beyond the helper function.- GitHub snapshot files are saved under
GitHub_Utils/followers/andGitHub_Utils/following/. cv_classes.pyuses OpenCV display windows (cv2.imshow) and needs a GUI-capable environment.











