Skip to content

Instantly share code, notes, and snippets.

View ryanking13's full-sized avatar

Gyeongjae Choi ryanking13

View GitHub Profile
@ryanking13
ryanking13 / predict.py
Created April 23, 2022 01:24
KCAPTCHA prediction
import tensorflow as tf
from tensorflow.keras.preprocessing import image
from tensorflow.keras.applications import densenet
import numpy as np
def decode_prediction(predicted, char_set, length=2):
l = len(char_set)
chars = []
for i in range(length):
chars.append(char_set[np.argmax(predicted[i * l : (i + 1) * l])])
from pathlib import Path
configured_path = Path(__file__).parent.parent / "cpython" / "installs" / "python-3.11.3" / "lib" / "python3.11"
archive_path = Path(__file__).parent.parent / ".." / "temp" / "cpython-3.11.3" / "Lib"
configured_lib = configured_path
archive_lib = archive_path