thedevvikas commited on
Commit
a0db1e3
·
1 Parent(s): 960c6de

fix: Sample files missing

Browse files
Files changed (6) hide show
  1. .gitattributes +1 -0
  2. app.py +7 -7
  3. sample/.DS_Store +0 -0
  4. sample/cat.jpg +3 -0
  5. sample/dog.jpg +3 -0
  6. sample/dunno.jpg +3 -0
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ sample/*.jpg filter=lfs diff=lfs merge=lfs -text
app.py CHANGED
@@ -1,24 +1,24 @@
1
- # AUTOGENERATED! DO NOT EDIT! File to edit: dog-or-cat.ipynb.
2
 
3
  # %% auto 0
4
  __all__ = ['learner', 'categories', 'example_imgs_path', 'img', 'label', 'examples', 'intf', 'is_cat', 'classify_image']
5
 
6
- # %% dog-or-cat.ipynb 2
7
  # Imports
8
  from fastai.vision.all import PILImage
9
  from fastai.vision.all import load_learner
10
  from pathlib import Path
11
  import gradio as gr
12
 
13
- # %% dog-or-cat.ipynb 4
14
  # Function to check if it is a cat
15
  def is_cat(x): return x[0].isupper()
16
 
17
- # %% dog-or-cat.ipynb 6
18
  # Load the trained model
19
  learner = load_learner(fname="./dog_or_cat.pkl")
20
 
21
- # %% dog-or-cat.ipynb 8
22
  categories = ("Cat", "Dog")
23
 
24
  def classify_image(img):
@@ -26,8 +26,8 @@ def classify_image(img):
26
  print(pred, idx)
27
  return dict(zip(categories, map(float, probs)))
28
 
29
- # %% dog-or-cat.ipynb 10
30
- example_imgs_path = Path("../data/test_images/examples")
31
  img = gr.Image()
32
  label = gr.Label()
33
  examples = [
 
1
+ # AUTOGENERATED! DO NOT EDIT! File to edit: ../course22/vikas/dog-or-cat.ipynb.
2
 
3
  # %% auto 0
4
  __all__ = ['learner', 'categories', 'example_imgs_path', 'img', 'label', 'examples', 'intf', 'is_cat', 'classify_image']
5
 
6
+ # %% ../course22/vikas/dog-or-cat.ipynb 2
7
  # Imports
8
  from fastai.vision.all import PILImage
9
  from fastai.vision.all import load_learner
10
  from pathlib import Path
11
  import gradio as gr
12
 
13
+ # %% ../course22/vikas/dog-or-cat.ipynb 4
14
  # Function to check if it is a cat
15
  def is_cat(x): return x[0].isupper()
16
 
17
+ # %% ../course22/vikas/dog-or-cat.ipynb 6
18
  # Load the trained model
19
  learner = load_learner(fname="./dog_or_cat.pkl")
20
 
21
+ # %% ../course22/vikas/dog-or-cat.ipynb 8
22
  categories = ("Cat", "Dog")
23
 
24
  def classify_image(img):
 
26
  print(pred, idx)
27
  return dict(zip(categories, map(float, probs)))
28
 
29
+ # %% ../course22/vikas/dog-or-cat.ipynb 10
30
+ example_imgs_path = Path("../sample")
31
  img = gr.Image()
32
  label = gr.Label()
33
  examples = [
sample/.DS_Store ADDED
Binary file (6.15 kB). View file
 
sample/cat.jpg ADDED

Git LFS Details

  • SHA256: 4004a7e48c848487994e24868290958d36d352cc66b4010e5764e43028ea4b0d
  • Pointer size: 132 Bytes
  • Size of remote file: 2.23 MB
sample/dog.jpg ADDED

Git LFS Details

  • SHA256: 958b143dee90af117261879f35e9345cd5c023e323de601204402568760bdc1c
  • Pointer size: 132 Bytes
  • Size of remote file: 1.15 MB
sample/dunno.jpg ADDED

Git LFS Details

  • SHA256: 080efb8339b9f0312c69a46d15839baa4dd233e9b256a8884f527915bef98ea1
  • Pointer size: 132 Bytes
  • Size of remote file: 3.72 MB