Skip to content

Instantly share code, notes, and snippets.

View edavidk7's full-sized avatar

David K. edavidk7

View GitHub Profile
@edavidk7
edavidk7 / collisionLSH.py
Created August 9, 2021 18:45 — forked from unrealwill/collisionLSH.py
Proof of Concept : generating collisions on a neural perceptual hash
import tensorflow as tf #We need tensorflow 2.x
import numpy as np
#The hashlength in bits
hashLength = 256
def buildModel():
#we can set the seed to simulate the fact that this network is known and doesn't change between runs
#tf.random.set_seed(42)
model = tf.keras.Sequential()