Spaces:
Running
on
T4
Running
on
T4
updates
Browse files- main.py +4 -2
- static/index.html +9 -2
main.py
CHANGED
@@ -62,7 +62,7 @@ def generate_image(prompt, model):
|
|
62 |
subprocess.check_output(
|
63 |
[
|
64 |
"cp",
|
65 |
-
"output.jpg"
|
66 |
"static/" + filename,
|
67 |
]
|
68 |
)
|
@@ -103,8 +103,10 @@ def verify_image(fileUpload: UploadFile):
|
|
103 |
|
104 |
original_media_string = str(response_list[2])
|
105 |
original_media = original_media_string.split(":", 1)
|
|
|
|
|
106 |
|
107 |
-
return {"response": fileUpload.filename, "contains_c2pa" : c2pa[1], "contains_watermark" : watermark[1], "original_media" : original_media
|
108 |
|
109 |
|
110 |
|
|
|
62 |
subprocess.check_output(
|
63 |
[
|
64 |
"cp",
|
65 |
+
"output.jpg",
|
66 |
"static/" + filename,
|
67 |
]
|
68 |
)
|
|
|
103 |
|
104 |
original_media_string = str(response_list[2])
|
105 |
original_media = original_media_string.split(":", 1)
|
106 |
+
original_media = str(original_media[1])
|
107 |
+
original_media = original_media.strip()
|
108 |
|
109 |
+
return {"response": fileUpload.filename, "contains_c2pa" : c2pa[1].strip(), "contains_watermark" : watermark[1].strip(), "original_media" : original_media}
|
110 |
|
111 |
|
112 |
|
static/index.html
CHANGED
@@ -247,12 +247,18 @@
|
|
247 |
.then((data) => {
|
248 |
console.log(data);
|
249 |
|
|
|
|
|
|
|
|
|
|
|
|
|
250 |
const path = "/" + data.response;
|
251 |
|
252 |
var resultsContainer = document.getElementById("image-container");
|
253 |
|
254 |
var truepicDisplay = document.createElement("truepic-display");
|
255 |
-
|
256 |
truepicDisplay.addEventListener(
|
257 |
"validate",
|
258 |
setVerificationOutputFromValidation
|
@@ -261,7 +267,7 @@
|
|
261 |
"validate",
|
262 |
setCertificateOutputFromValidation
|
263 |
);
|
264 |
-
|
265 |
|
266 |
truepicDisplay.setAttribute("id", "result");
|
267 |
truepicDisplay.setAttribute("active", "");
|
@@ -271,6 +277,7 @@
|
|
271 |
truepicDisplay.appendChild(truepic);
|
272 |
|
273 |
resultsContainer.appendChild(truepicDisplay);
|
|
|
274 |
// Handle response data
|
275 |
})
|
276 |
.catch((error) => {
|
|
|
247 |
.then((data) => {
|
248 |
console.log(data);
|
249 |
|
250 |
+
console.log("contains_c2pa", data.contains_c2pa);
|
251 |
+
console.log("contains_watermark", data.contains_watermark);
|
252 |
+
console.log("original_media", data.original_media);
|
253 |
+
|
254 |
+
|
255 |
+
/*
|
256 |
const path = "/" + data.response;
|
257 |
|
258 |
var resultsContainer = document.getElementById("image-container");
|
259 |
|
260 |
var truepicDisplay = document.createElement("truepic-display");
|
261 |
+
|
262 |
truepicDisplay.addEventListener(
|
263 |
"validate",
|
264 |
setVerificationOutputFromValidation
|
|
|
267 |
"validate",
|
268 |
setCertificateOutputFromValidation
|
269 |
);
|
270 |
+
|
271 |
|
272 |
truepicDisplay.setAttribute("id", "result");
|
273 |
truepicDisplay.setAttribute("active", "");
|
|
|
277 |
truepicDisplay.appendChild(truepic);
|
278 |
|
279 |
resultsContainer.appendChild(truepicDisplay);
|
280 |
+
*/
|
281 |
// Handle response data
|
282 |
})
|
283 |
.catch((error) => {
|