Nipun commited on
Commit
43928d2
·
1 Parent(s): cd64d36

Initial commit with Git LFS setup

Browse files
.gitattributes CHANGED
@@ -33,3 +33,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ *.png filter=lfs diff=lfs merge=lfs -text
37
+ *.jpeg filter=lfs diff=lfs merge=lfs -text
38
+ *.jpg filter=lfs diff=lfs merge=lfs -text
app.py ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import os, json
3
+
4
+ IMG_DIR = "images"
5
+ VOTE_FILE = "votes.json"
6
+
7
+ # Ensure votes.json exists with image names
8
+ if not os.path.exists(VOTE_FILE):
9
+ votes = {}
10
+
11
+ if os.path.exists(VOTE_FILE):
12
+ with open(VOTE_FILE, 'r') as f:
13
+ votes = json.load(f)
14
+
15
+ # Initialize votes for new images
16
+ for img in os.listdir(IMG_DIR):
17
+ if img not in votes:
18
+ votes[img] = 0
19
+
20
+ # Save updated votes.json
21
+ with open(VOTE_FILE, 'w') as f:
22
+ json.dump(votes, f, indent=2)
23
+
24
+ st.title("Vote for the Best Logo")
25
+
26
+ # Display images and vote buttons
27
+ for img in sorted(votes.keys()):
28
+ st.image(os.path.join(IMG_DIR, img), width=200)
29
+ if st.button(f"Vote for {img}"):
30
+ votes[img] += 1
31
+ with open(VOTE_FILE, 'w') as f:
32
+ json.dump(votes, f, indent=2)
33
+ st.success(f"Voted for {img}")
34
+ st.experimental_rerun()
35
+
36
+ # Display current vote tally
37
+ st.header("Live Results")
38
+ for img, count in sorted(votes.items(), key=lambda x: -x[1]):
39
+ st.markdown(f"**{img}**: {count} votes")
images/nipun-2.png ADDED

Git LFS Details

  • SHA256: 0bb8619b5da80b9f10d4a64ebc633c9e5e6f1e97be88947a2df6573d5721f9b8
  • Pointer size: 132 Bytes
  • Size of remote file: 1.29 MB
images/nipun-3.png ADDED

Git LFS Details

  • SHA256: 7cb5458364405f394475897efee36acddb4123cb6e670152138981708b68c5b8
  • Pointer size: 132 Bytes
  • Size of remote file: 1.4 MB
images/original.jpeg ADDED

Git LFS Details

  • SHA256: a83732c6943e5769f6780ca061b054c333df449b8edb7959329eb28d9d4e220f
  • Pointer size: 131 Bytes
  • Size of remote file: 104 kB
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ streamlit