stefan-it commited on
Commit
3ffb978
·
1 Parent(s): 44745b0

app: fix rescaling (no longer resize image)

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -41,7 +41,7 @@ def inference(image):
41
 
42
  height = image.height
43
 
44
- img = np.array(image.resize((500, height)))
45
  outputs = predictor(img)
46
 
47
  v = Visualizer(img, my_metadata, scale=1.2)
@@ -50,7 +50,7 @@ def inference(image):
50
  return out.get_image()
51
 
52
  title = "DBMDZ Detectron2 Model Demo"
53
- description = "This demo introduces an interactive playground for our trained Detectron2 model. <br>The model was trained on manually annotated segments from digitized books to detect Illustration or Illumination segments on a given page. Classification threshold is set to 0.8."
54
  article = '<p>Detectron model is available from our repository <a href="">here</a> on the Hugging Face Model Hub.</p>'
55
 
56
  gr.Interface(
 
41
 
42
  height = image.height
43
 
44
+ img = np.array(image)
45
  outputs = predictor(img)
46
 
47
  v = Visualizer(img, my_metadata, scale=1.2)
 
50
  return out.get_image()
51
 
52
  title = "DBMDZ Detectron2 Model Demo"
53
+ description = "This demo introduces an interactive playground for our trained Detectron2 model. <br>The model was trained on manually annotated segments from digitized books to detect Illustration or Illumination segments on a given page. <br>Minimum score for classification is set to 80%."
54
  article = '<p>Detectron model is available from our repository <a href="">here</a> on the Hugging Face Model Hub.</p>'
55
 
56
  gr.Interface(