sswam commited on
Commit
15d5167
1 Parent(s): 6fa34a8

improve notebook, I like tabs

Browse files
Files changed (2) hide show
  1. app.py +11 -11
  2. photo-checker.ipynb +0 -0
app.py CHANGED
@@ -7,19 +7,19 @@ learn = load_learner('photos.pkl')
7
  labels = learn.dls.vocab
8
 
9
  def predict(img):
10
- img = PILImage.create(img)
11
- pred, pred_idx, probs = learn.predict(img)
12
- return dict(zip(labels, map(float, probs)))
13
 
14
  iface = gr.Interface(
15
- title = "Photo Checker",
16
- description = "Check if one of our family photos is good or not. It tries to exclude screenshots, photos of computer screens, photos of papers, images with lots of text, and very blurry images. I intend to use this to separate the good photos for a slide show on our TV. It achieves over 99% accuracy based on my testing.",
17
- fn = predict,
18
- inputs = gr.inputs.Image(shape = (512,512)),
19
- outputs = gr.outputs.Label(num_top_classes = 3),
20
- examples = list(map(str, get_image_files('eg'))),
21
- interpretation='default',
22
- # enable_queue=True,
23
  )
24
 
25
  iface.launch()
 
7
  labels = learn.dls.vocab
8
 
9
  def predict(img):
10
+ img = PILImage.create(img)
11
+ pred, pred_idx, probs = learn.predict(img)
12
+ return dict(zip(labels, map(float, probs)))
13
 
14
  iface = gr.Interface(
15
+ title = "Photo Checker",
16
+ description = """This project checks which of our family photos are "good" or "bad". We have nearly 80,000 photos, so it's not practical to sort them out by hand. I want to exclude screenshots, photos of computer screens, photos of papers, images with lots of text, and very blurry images. I used this to separate the good photos to use for a random slide show on our TV. The trained model achieves around 99% accuracy on the validation set.""",
17
+ fn = predict,
18
+ inputs = gr.inputs.Image(shape = (512,512)),
19
+ outputs = gr.outputs.Label(num_top_classes = 3),
20
+ examples = list(map(str, get_image_files('eg'))),
21
+ interpretation='default',
22
+ enable_queue=True,
23
  )
24
 
25
  iface.launch()
photo-checker.ipynb CHANGED
The diff for this file is too large to render. See raw diff