NBoukachab commited on
Commit
a825fd3
1 Parent(s): 670fc2f

Add comments

Browse files
Files changed (1) hide show
  1. app.py +8 -10
app.py CHANGED
@@ -82,15 +82,13 @@ def query_image(image):
82
  # Add an index to dictionary keys to differentiate predictions of the same class
83
  predict.append(
84
  {
85
- "polygon": np.asarray(polygon["polygon"])
86
- .astype(int)
87
- .tolist(), # The list of coordinates of the points of the polygon
88
- "confidence": polygon[
89
- "confidence"
90
- ], # Confidence that the model predicts the polygon in the right place
91
- "channel": classes[
92
- channel
93
- ], # The channel on which the polygon is predicted
94
  }
95
  )
96
 
@@ -101,7 +99,7 @@ def query_image(image):
101
  with gr.Blocks() as process_image:
102
 
103
  # Create app title
104
- gr.Markdown(f"<h1 align='center'>{config['title']}</h1>")
105
 
106
  # Create app description
107
  gr.Markdown(config["description"])
 
82
  # Add an index to dictionary keys to differentiate predictions of the same class
83
  predict.append(
84
  {
85
+ # The list of coordinates of the points of the polygon.
86
+ # Use np.asarray to change list to ndarray to turn int64 to int32 with np.ndarray.tolist
87
+ "polygon": np.asarray(polygon["polygon"]).tolist(),
88
+ # Confidence that the model predicts the polygon in the right place
89
+ "confidence": polygon["confidence"],
90
+ # The channel on which the polygon is predicted
91
+ "channel": classes[channel],
 
 
92
  }
93
  )
94
 
 
99
  with gr.Blocks() as process_image:
100
 
101
  # Create app title
102
+ gr.Markdown(f"# {config['title']}")
103
 
104
  # Create app description
105
  gr.Markdown(config["description"])