Posts by @Jasper_Holton (359)

My name is Jasper Camber Holton. I write, code, make music, and I am the developer of

Has 359 posts, follows 17 users and is followed by 12 users.

Last seen at October 06, 2022 14:12

@Jasper_Holton's profile photo

GFPGAN Face Restoration for Beautiful Faces with Python This is how I make my face photos look even nicer from the web shell and photobooth webapp. Try it out, you won't be disappointed! To run the command,

from subprocess import Popen, STDOUT, PIPE

banned_commands = ['rm']

def run_command(command):
    cmd = command.split(' ')
    if cmd[0] in banned_commands:
        return 'command not accepted.\n'
    proc = Popen(cmd, stdout=PIPE, stderr=STDOUT, cwd='/home/team/clemn')
To enhance the image,

from shell.execute import run_command
import shutil
import os

base_dir = '/home/team/theapp/temp/gfpgan/'
op_dir = '/home/team/theapp/temp/gfpgan-output/'

def gfpgan_enhance(image_path):
    filename = image_path.split('/')[-1]
    path = os.path.join(base_dir, filename)
    shutil.copy(image_path, path)
    print(run_command('venv/bin/python GFPGAN/ -i {} -o {} -v 1.3 -s 2'.format(base_dir, op_dir)))
    dest_path = os.path.join(op_dir, filename)
    shutil.copy(dest_path, image_path)
Download and install information for GFPGAN is found here: Enjoy!

@Jasper_Holton's profile photo

I am making the best of my coding skills and dedication to beauty with my nuclear security solution for adults. I'll post more about the apps on there and the function of the webapp soon. Message me for a link, don't be shy!

View the photo from a post by @Jasper_Holton

@Jasper_Holton, @AussieinthePNW, like this,

@Jasper_Holton's profile photo

How to isolate a license plate or document from an image using Python I use this code to create really perfect ID scans which contain just the ID from an image. The code looks for the largest square in the image using computer vision. This is useful for OCR, forensics, verification, or any situation where documents are processed. The code can be modified to isolate anything from an image with contours, like a street sign, cell phone, building or anything else.

# isolate the id from the image scan
import cv2

def write_isolated(image_path, output_path):
    image = cv2.imread(image_path)
    gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
    thresh_img = cv2.threshold(gray_image, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU)[1]
    cnts = cv2.findContours(thresh_img, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
    cnts = cnts[0] if len(cnts) == 2 else cnts[1]
    cnts = sorted(cnts, key=cv2.contourArea, reverse=True)[:5]
    for c in cnts:
        perimeter = cv2.arcLength(c, True)
        approx = cv2.approxPolyDP(c, 0.018 * perimeter, True)
        if len(approx) >= 4:
            x,y,w,h = cv2.boundingRect(c)
            new_img = image[y:y+h,x:x+w]
            cv2.imwrite(output_path, new_img)
            return output_path
    return None

@Jasper_Holton's profile photo

Visit this link on Uglek - - to become a member and enjoy all sorts of exclusive member benefits including ways to make money on your profile. Uglek is free to use, but it's better with a membership. You won't see ads, you'll get a larger cut from subscriptions and funding, and you'll get to see exclusive posts at /members/. Please consider a membership to help keep the site alive.

© Uglek, 2022

Terms of Use and Privacy Policy