pgurazada1 commited on
Commit
2c30d89
·
verified ·
1 Parent(s): 16e8e36

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -22
app.py CHANGED
@@ -25,25 +25,9 @@ def decision(png_file_path, client, lmm: str) -> str:
25
  image_data = generate_data_uri(png_file_path)
26
 
27
  system_message = """
28
- You are an expert in cricket tasked to judge whether a batter is out by Leg Before Wicket (LBW). You will be presented with an image of the ball hitting a batter's pads and you will have to make a decision whether the batter is to be judged out or not applying the following rules.
29
-
30
- There are three important zones to consider while making your decision.
31
- - Pitching Zone: The Pitching Zone is the two-dimensional area that spans the length of the pitch, with the outer edges of the stumps at each end acting as its boundaries. 
32
- - Impact Zone: The Impact Zone is where the ball hits the batter’s pad for the first time. It is a three-dimensional area spaced between both sets of stumps, from ground level to an indefinite height. The outer edge of the leg and off stump act as its outer boundaries.
33
- - Wicket Zone: The Wicket Zone is a two-dimensional space, with the stumps, from their base to the top of the bails, and the full width from the outer edge of the off and leg stumps, bounding the area. 
34
-
35
- Given the image, you will need to project its trajectory between the impact zone and wicket zone. If you conclude that the ball will end up in the wicket zone, the batter needs to be adjudged "Out". If you conclude that the ball will end up outside the wicket zone, the batter needs to be adjudged "Not Out". Specifically, you should check that:
36
- - The ball pitches in line between the wicket and wicket or on the off side of the batters wicket (i.e., the ball should be in the pitching zone or on the off side of the batter's wicket)
37
- - The batter intercepts the ball with any part of their body, except their hands, either full-pitch or after pitching (i.e., the impact zone should be within the leg and off stump)
38
- - The point of impact is between wicket and wicket, even if above the level of the bails (i.e., it should be in the wicket zone)
39
-
40
- Present your final answer as a JSON object with the following structure:
41
- {{
42
- "decision": out or not out
43
- "reason": detailed explanation of which rules were applied and why the decision was made
44
- }}
45
-
46
- Do not output anything before or after the JSON.
47
  """
48
 
49
  decision_prompt = [
@@ -90,9 +74,9 @@ demo = gr.Interface(
90
  fn=predict,
91
  inputs=gr.Image(type="filepath", label="Upload your image"),
92
  outputs=gr.Text(label="Verdict"),
93
- title="DRS for LBW Decisions",
94
- description="This web API presents an interface to review LBW decisions using image input.",
95
- examples='data',
96
  cache_examples=False,
97
  theme=gr.themes.Base(),
98
  concurrency_limit=16
 
25
  image_data = generate_data_uri(png_file_path)
26
 
27
  system_message = """
28
+ You are an expert in describing images and plots presented in company annual reports.
29
+ For plots, ensure that you describe the plot and also the key trends/findings observed in the plot.
30
+ Be detailed in your exposition.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  """
32
 
33
  decision_prompt = [
 
74
  fn=predict,
75
  inputs=gr.Image(type="filepath", label="Upload your image"),
76
  outputs=gr.Text(label="Verdict"),
77
+ title="Plot Explainer",
78
+ description="This web API presents an interface to explain plots in detail.",
79
+ examples='images',
80
  cache_examples=False,
81
  theme=gr.themes.Base(),
82
  concurrency_limit=16