Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -208,13 +208,13 @@ def get_hash(img):
|
|
208 |
|
209 |
|
210 |
cache = {
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
}
|
219 |
|
220 |
def inference(first_img, second_img):
|
@@ -233,7 +233,7 @@ def inference(first_img, second_img):
|
|
233 |
|
234 |
|
235 |
title = "Generate a Neural Hash Collision"
|
236 |
-
description = "Apple's NeuralHash, a perceptual hashing method for images based on neural networks, has been criticized heavily by researchers. You can use this demo to generate a hash collision of any two images. Upload your own (or click one of the examples to load them), and an adverserial image will be created from the first one to match the hash of the second. Note: In some cases the generation times out (we set a limit of 1000 iterations). The examples are cached, but submitting your own images should take about
|
237 |
article = "<p style='text-align: center'><a href='https://www.apple.com/child-safety/pdf/CSAM_Detection_Technical_Summary.pdf'>CSAM Detection Technical Summary</a> | <a href='https://github.com/AsuharietYgvar/AppleNeuralHash2ONNX'>AppleNeuralHash2ONNX Github Repo</a> | <a href='https://github.com/anishathalye/neural-hash-collider'>Neural Hash Collider Repo</a> | <a href='https://github.com/AsuharietYgvar/AppleNeuralHash2ONNX/issues/1'>Working Collision example images from github issue</a></p> "
|
238 |
examples = [
|
239 |
["images/cat.png", "images/dog.png"],
|
@@ -253,4 +253,4 @@ gr.Interface(
|
|
253 |
allow_flagging=False,
|
254 |
theme="huggingface",
|
255 |
capture_session=True
|
256 |
-
).launch(share=True
|
208 |
|
209 |
|
210 |
cache = {
|
211 |
+
"732777d208dff6dd3268cb5a59a34eabe31910abfb06f308": (pre_text.format("732777d208dff6dd3268cb5a"), pre_text.format("59a34eabe31910abfb06f308"), ["cached/example1.png", "images/dog.png"]),
|
212 |
+
"32dac883f7b91bbf45a4829635f7238ba05c404756bb33ee": (
|
213 |
+
pre_text.format("32dac883f7b91bbf45a48296"), pre_text.format("35f7238ba05c404756bb33ee"),
|
214 |
+
["cached/example2.png", "images/apple.png"]),
|
215 |
+
"f16d358106da998227b323f2a73e6ec2303af3d801f9133a": (
|
216 |
+
pre_text.format("f16d358106da998227b323f2"), pre_text.format("a73e6ec2303af3d801f9133a"),
|
217 |
+
["cached/example3.png", "images/iphone.png"])
|
218 |
}
|
219 |
|
220 |
def inference(first_img, second_img):
|
233 |
|
234 |
|
235 |
title = "Generate a Neural Hash Collision"
|
236 |
+
description = "Apple's NeuralHash, a perceptual hashing method for images based on neural networks, has been criticized heavily by researchers. You can use this demo to generate a hash collision of any two images. Upload your own (or click one of the examples to load them), and an adverserial image will be created from the first one to match the hash of the second. Note: In some cases the generation times out (we set a limit of 1000 iterations). The examples are cached, but submitting your own images should take about a minute. Read more at the links below."
|
237 |
article = "<p style='text-align: center'><a href='https://www.apple.com/child-safety/pdf/CSAM_Detection_Technical_Summary.pdf'>CSAM Detection Technical Summary</a> | <a href='https://github.com/AsuharietYgvar/AppleNeuralHash2ONNX'>AppleNeuralHash2ONNX Github Repo</a> | <a href='https://github.com/anishathalye/neural-hash-collider'>Neural Hash Collider Repo</a> | <a href='https://github.com/AsuharietYgvar/AppleNeuralHash2ONNX/issues/1'>Working Collision example images from github issue</a></p> "
|
238 |
examples = [
|
239 |
["images/cat.png", "images/dog.png"],
|
253 |
allow_flagging=False,
|
254 |
theme="huggingface",
|
255 |
capture_session=True
|
256 |
+
).launch(share=True)
|