JustKiddo commited on
Commit
5ac3549
·
verified ·
1 Parent(s): 6bc3d42

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -4,6 +4,8 @@ from huggingface_hub import InferenceClient
4
 
5
  client = InferenceClient("models/microsoft/trocr-base-handwritten")
6
 
 
 
7
  def sepia(input_img):
8
  sepia_filter = np.array([
9
  [0.393, 0.769, 0.189],
@@ -12,7 +14,8 @@ def sepia(input_img):
12
  ])
13
  sepia_img = input_img.dot(sepia_filter.T)
14
  sepia_img /= sepia_img.max()
15
- return sepia_img
 
16
 
17
 
18
  ## https://www.gradio.app/docs/gradio/blocks
@@ -30,7 +33,7 @@ with gr.Blocks() as generated_output:
30
  with gr.Column():
31
  gr.Interface(sepia, gr.Image(), "image")
32
  with gr.Row():
33
- gr.Textbox()
34
 
35
  #with gr.Blocks() as generated_output:
36
  # inp = gr.Interface(sepia, gr.Image(), "image")
 
4
 
5
  client = InferenceClient("models/microsoft/trocr-base-handwritten")
6
 
7
+ sepia_value = []
8
+
9
  def sepia(input_img):
10
  sepia_filter = np.array([
11
  [0.393, 0.769, 0.189],
 
14
  ])
15
  sepia_img = input_img.dot(sepia_filter.T)
16
  sepia_img /= sepia_img.max()
17
+ sepia_img = sepia_value
18
+ return sepia_img, sepia_value
19
 
20
 
21
  ## https://www.gradio.app/docs/gradio/blocks
 
33
  with gr.Column():
34
  gr.Interface(sepia, gr.Image(), "image")
35
  with gr.Row():
36
+ gr.Textbox(sepia_value, label="Sepia values")
37
 
38
  #with gr.Blocks() as generated_output:
39
  # inp = gr.Interface(sepia, gr.Image(), "image")