ez326 commited on
Commit
b8406fc
·
verified ·
1 Parent(s): c3a2fab

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +58 -14
app.py CHANGED
@@ -1,27 +1,71 @@
1
  import streamlit as st
2
  import numpy as np
3
 
4
- categories = [
5
- "Dialogue", "Screenwriting", "Acting", "Editing", "Foley",
6
- "Score", "Plot", "Cinematography", "Production Design",
7
- "Costume & Makeup", "Visual Effects", "Sound Design",
8
- "Directing", "Pacing", "Character Development", "Rewatchability",
9
- "Originality", "Framing", "Color Grading", "Spatial Audio",
10
- "Stunt Choreography"
11
- ]
12
 
13
- ratings = {}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
- st.title("Movie Rating System")
16
 
17
- for category in categories:
18
- ratings[category] = st.slider(category, 1, 7, 4)
 
 
 
 
19
 
 
20
  if st.button("Calculate Score"):
21
- valid_ratings = [v for v in ratings.values() if v is not None]
22
  if valid_ratings:
23
  avg = np.mean(valid_ratings)
24
- scaled_score = 1 + ((avg - 1) * (9 / 6))
 
 
25
  st.success(f"Final Scaled Score: {scaled_score:.2f} / 10")
26
  else:
27
  st.warning("Please rate at least one category.")
 
1
  import streamlit as st
2
  import numpy as np
3
 
4
+ st.title("Movie Rating System")
 
 
 
 
 
 
 
5
 
6
+ # Define criteria grouped by category with subcategory descriptions
7
+ criteria = {
8
+ "Writing": [
9
+ {"name": "Dialogue", "description": "Word choice, realism, subtext, and implications."},
10
+ {"name": "Screenwriting", "description": "Structure, plot progression, and narrative choices."},
11
+ {"name": "Character Development", "description": "Depth, relatability, motivations, and arcs."},
12
+ {"name": "Theme & Symbolism", "description": "Use of deeper meaning, metaphors, and thematic consistency."}
13
+ ],
14
+ "Cinematography": [
15
+ {"name": "Camera Work", "description": "Shot composition, stability, movement, and angles."},
16
+ {"name": "Lighting", "description": "Contrast, exposure control, and mood-setting."},
17
+ {"name": "Color Grading", "description": "Palette consistency, contrast, and emotional tone."},
18
+ {"name": "Framing & Aspect Ratio", "description": "Use of space, focus, and visual storytelling."}
19
+ ],
20
+ "Editing & Pacing": [
21
+ {"name": "Scene Transitions", "description": "Smoothness, creativity, and effectiveness."},
22
+ {"name": "Continuity", "description": "Logical flow and lack of visual inconsistencies."},
23
+ {"name": "Pacing", "description": "Balance between slow and fast scenes, engagement level."},
24
+ {"name": "Use of Montage", "description": "Storytelling efficiency via edited sequences."}
25
+ ],
26
+ "Sound": [
27
+ {"name": "Dialogue Mixing", "description": "Clarity, balance, and intelligibility of speech."},
28
+ {"name": "Foley & Sound Effects", "description": "Realism, accuracy, and integration into the world."},
29
+ {"name": "Score & Music", "description": "Uniqueness, memorability, and emotional impact."},
30
+ {"name": "Spatial Audio & Atmosphere", "description": "Immersion, ambient sound accuracy, and use of silence."}
31
+ ],
32
+ "Directing & Performance": [
33
+ {"name": "Directing", "description": "Cohesion of vision, creative choices, and execution."},
34
+ {"name": "Acting", "description": "Expression, dialogue delivery, and emotional depth."},
35
+ {"name": "Blocking & Staging", "description": "Character positioning, movement, and scene composition."},
36
+ {"name": "Action & Stunt Choreography", "description": "Realism, execution, and visual readability."}
37
+ ],
38
+ "Production & Visuals": [
39
+ {"name": "Production Design", "description": "Set design, world-building, and authenticity."},
40
+ {"name": "Costume & Makeup", "description": "Period accuracy, character enhancement, and detailing."},
41
+ {"name": "Practical Effects & Props", "description": "Use of real elements over CGI, believability."},
42
+ {"name": "VFX & CGI Integration", "description": "Quality, realism, and seamless blending."}
43
+ ],
44
+ "Engagement & Replay Value": [
45
+ {"name": "Plot", "description": "Uniqueness, engagement, predictability, and emotional weight."},
46
+ {"name": "Originality", "description": "Avoidance of clichés, fresh storytelling, and innovation."},
47
+ {"name": "Rewatchability", "description": "Whether the movie holds up over multiple viewings."},
48
+ {"name": "Emotional Impact", "description": "Strength of connection, intensity of response."}
49
+ ]
50
+ }
51
 
52
+ ratings = {}
53
 
54
+ # Create sliders for each subcategory under its category header
55
+ for group, subcriteria in criteria.items():
56
+ st.header(group)
57
+ for crit in subcriteria:
58
+ label = f"{crit['name']}: {crit['description']}"
59
+ ratings[crit["name"]] = st.slider(label, min_value=1, max_value=7, value=4)
60
 
61
+ # When the button is pressed, calculate the overall score
62
  if st.button("Calculate Score"):
63
+ valid_ratings = list(ratings.values())
64
  if valid_ratings:
65
  avg = np.mean(valid_ratings)
66
+ # Quadratic mapping f(x) = (1/18)x^2 + (19/18)x - (1/9)
67
+ # so that f(1)=1, f(4)=5, and f(7)=10.
68
+ scaled_score = (1/18) * (avg ** 2) + (19/18) * avg - (1/9)
69
  st.success(f"Final Scaled Score: {scaled_score:.2f} / 10")
70
  else:
71
  st.warning("Please rate at least one category.")