Spaces:
Sleeping
Sleeping
jaifar530
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,45 @@ import numpy as np
|
|
12 |
from PIL import Image
|
13 |
from joblib import load
|
14 |
import math
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
|
18 |
|
@@ -325,12 +363,12 @@ if press_me_button:
|
|
325 |
if ridge_prediction == extra_trees_prediction == predicted_author:
|
326 |
st.success(f"Most likely written by: **{ridge_name}**", icon="β
")
|
327 |
st.info("We are quite confident in the accuracy of this result.", icon="βΉοΈ")
|
328 |
-
rain(
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
)
|
334 |
|
335 |
else:
|
336 |
# Repeat the text with a space at the end of each iteration
|
@@ -380,48 +418,48 @@ if press_me_button:
|
|
380 |
st.success(f"Most likely written by: **{ridge_name}**", icon="β
")
|
381 |
st.warning(f"**Notice:** Your input text has been magnified {amplify} times to better capture its characteristics and patterns.", icon="β οΈ")
|
382 |
st.write("_" * 30)
|
383 |
-
rain(
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
)
|
389 |
|
390 |
elif ridge_prediction == extra_trees_prediction:
|
391 |
st.success(f"Most likely written by: **{ridge_name}**", icon="β
")
|
392 |
st.success(f"2nd Most likely written by: **{cnn_name}**", icon="β
")
|
393 |
st.warning(f"**Notice:** The input text has been magnified {amplify} times to better capture its characteristics and patterns.", icon="β οΈ")
|
394 |
st.write("_" * 30)
|
395 |
-
rain(
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
)
|
401 |
|
402 |
elif extra_trees_prediction == predicted_author:
|
403 |
st.success(f"Most likely written by: **{extra_trees_name}**", icon="β
")
|
404 |
st.success(f"2nd Most likely written by: **{ridge_name}**", icon="β
")
|
405 |
st.warning(f"**Notice:** The input text has been magnified {amplify} times to better capture its characteristics and patterns.", icon="β οΈ")
|
406 |
st.write("_" * 30)
|
407 |
-
rain(
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
)
|
413 |
|
414 |
elif ridge_prediction == predicted_author:
|
415 |
st.success(f"Most likely written by: **{ridge_name}**", icon="β
")
|
416 |
st.success(f"2nd Most likely written by: **{extra_trees_name}**", icon="β
")
|
417 |
st.warning(f"**Notice:** The input text has been magnified {amplify} times to better capture its characteristics and patterns.", icon="β οΈ")
|
418 |
st.write("_" * 30)
|
419 |
-
rain(
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
)
|
425 |
|
426 |
|
427 |
else:
|
@@ -431,12 +469,12 @@ if press_me_button:
|
|
431 |
st.success(f"3- **{extra_trees_name}**", icon="β
")
|
432 |
st.warning(f"**Notice 2:** The input text has been magnified {amplify} times to better capture its characteristics and patterns.", icon="β οΈ")
|
433 |
st.write("_" * 30)
|
434 |
-
rain(
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
)
|
440 |
|
441 |
|
442 |
# with st.expander("What is this project about?"):
|
|
|
12 |
from PIL import Image
|
13 |
from joblib import load
|
14 |
import math
|
15 |
+
import streamlit as st
|
16 |
+
|
17 |
+
st.title("Rain Emojis")
|
18 |
+
|
19 |
+
# Custom HTML and JavaScript for falling emojis
|
20 |
+
st.markdown(
|
21 |
+
"""
|
22 |
+
<style>
|
23 |
+
.emoji {
|
24 |
+
position: fixed;
|
25 |
+
font-size: 54px;
|
26 |
+
}
|
27 |
+
</style>
|
28 |
+
<div id="emoji-container"></div>
|
29 |
+
<script>
|
30 |
+
function makeEmojiFall() {
|
31 |
+
var emoji = document.createElement("div");
|
32 |
+
emoji.className = "emoji";
|
33 |
+
emoji.innerText = "π";
|
34 |
+
document.getElementById("emoji-container").appendChild(emoji);
|
35 |
+
emoji.style.left = Math.random() * window.innerWidth + "px";
|
36 |
+
emoji.style.animationDuration = Math.random() * 5 + 3 + "s";
|
37 |
+
emoji.style.animationName = "fall";
|
38 |
+
}
|
39 |
+
setInterval(makeEmojiFall, 1000);
|
40 |
+
</script>
|
41 |
+
<style>
|
42 |
+
@keyframes fall {
|
43 |
+
from {
|
44 |
+
top: -100px;
|
45 |
+
}
|
46 |
+
to {
|
47 |
+
top: 100vh;
|
48 |
+
}
|
49 |
+
}
|
50 |
+
</style>
|
51 |
+
""",
|
52 |
+
unsafe_allow_html=True,
|
53 |
+
)
|
54 |
|
55 |
|
56 |
|
|
|
363 |
if ridge_prediction == extra_trees_prediction == predicted_author:
|
364 |
st.success(f"Most likely written by: **{ridge_name}**", icon="β
")
|
365 |
st.info("We are quite confident in the accuracy of this result.", icon="βΉοΈ")
|
366 |
+
# rain(
|
367 |
+
# emoji="π",
|
368 |
+
# font_size=54,
|
369 |
+
# falling_speed=5,
|
370 |
+
# animation_length="infinite",
|
371 |
+
# )
|
372 |
|
373 |
else:
|
374 |
# Repeat the text with a space at the end of each iteration
|
|
|
418 |
st.success(f"Most likely written by: **{ridge_name}**", icon="β
")
|
419 |
st.warning(f"**Notice:** Your input text has been magnified {amplify} times to better capture its characteristics and patterns.", icon="β οΈ")
|
420 |
st.write("_" * 30)
|
421 |
+
# rain(
|
422 |
+
# emoji="π",
|
423 |
+
# font_size=54,
|
424 |
+
# falling_speed=5,
|
425 |
+
# animation_length="infinite",
|
426 |
+
# )
|
427 |
|
428 |
elif ridge_prediction == extra_trees_prediction:
|
429 |
st.success(f"Most likely written by: **{ridge_name}**", icon="β
")
|
430 |
st.success(f"2nd Most likely written by: **{cnn_name}**", icon="β
")
|
431 |
st.warning(f"**Notice:** The input text has been magnified {amplify} times to better capture its characteristics and patterns.", icon="β οΈ")
|
432 |
st.write("_" * 30)
|
433 |
+
# rain(
|
434 |
+
# emoji="π",
|
435 |
+
# font_size=54,
|
436 |
+
# falling_speed=5,
|
437 |
+
# animation_length="infinite",
|
438 |
+
# )
|
439 |
|
440 |
elif extra_trees_prediction == predicted_author:
|
441 |
st.success(f"Most likely written by: **{extra_trees_name}**", icon="β
")
|
442 |
st.success(f"2nd Most likely written by: **{ridge_name}**", icon="β
")
|
443 |
st.warning(f"**Notice:** The input text has been magnified {amplify} times to better capture its characteristics and patterns.", icon="β οΈ")
|
444 |
st.write("_" * 30)
|
445 |
+
# rain(
|
446 |
+
# emoji="π",
|
447 |
+
# font_size=54,
|
448 |
+
# falling_speed=5,
|
449 |
+
# animation_length="infinite",
|
450 |
+
# )
|
451 |
|
452 |
elif ridge_prediction == predicted_author:
|
453 |
st.success(f"Most likely written by: **{ridge_name}**", icon="β
")
|
454 |
st.success(f"2nd Most likely written by: **{extra_trees_name}**", icon="β
")
|
455 |
st.warning(f"**Notice:** The input text has been magnified {amplify} times to better capture its characteristics and patterns.", icon="β οΈ")
|
456 |
st.write("_" * 30)
|
457 |
+
# rain(
|
458 |
+
# emoji="π",
|
459 |
+
# font_size=54,
|
460 |
+
# falling_speed=5,
|
461 |
+
# animation_length="infinite",
|
462 |
+
# )
|
463 |
|
464 |
|
465 |
else:
|
|
|
469 |
st.success(f"3- **{extra_trees_name}**", icon="β
")
|
470 |
st.warning(f"**Notice 2:** The input text has been magnified {amplify} times to better capture its characteristics and patterns.", icon="β οΈ")
|
471 |
st.write("_" * 30)
|
472 |
+
# rain(
|
473 |
+
# emoji="π",
|
474 |
+
# font_size=54,
|
475 |
+
# falling_speed=5,
|
476 |
+
# animation_length="infinite",
|
477 |
+
# )
|
478 |
|
479 |
|
480 |
# with st.expander("What is this project about?"):
|