from fastai.vision.all import *
from huggingface_hub import push_to_hub_fastai, from_pretrained_fastai
import gradio as gr
import skimage
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
/Users/tompham/Document Files/Programming/GitHub/clothing-item-classification/_notebooks/2022-08-02-deploy-app.ipynb Cell 2 in <cell line: 3>()
      <a href='vscode-notebook-cell:/Users/tompham/Document%20Files/Programming/GitHub/clothing-item-classification/_notebooks/2022-08-02-deploy-app.ipynb#ch0000001?line=0'>1</a> #|export
      <a href='vscode-notebook-cell:/Users/tompham/Document%20Files/Programming/GitHub/clothing-item-classification/_notebooks/2022-08-02-deploy-app.ipynb#ch0000001?line=1'>2</a> from fastai.vision.all import *
----> <a href='vscode-notebook-cell:/Users/tompham/Document%20Files/Programming/GitHub/clothing-item-classification/_notebooks/2022-08-02-deploy-app.ipynb#ch0000001?line=2'>3</a> from huggingface_hub import push_to_hub_fastai, from_pretrained_fastai
      <a href='vscode-notebook-cell:/Users/tompham/Document%20Files/Programming/GitHub/clothing-item-classification/_notebooks/2022-08-02-deploy-app.ipynb#ch0000001?line=3'>4</a> import gradio as gr
      <a href='vscode-notebook-cell:/Users/tompham/Document%20Files/Programming/GitHub/clothing-item-classification/_notebooks/2022-08-02-deploy-app.ipynb#ch0000001?line=4'>5</a> import skimage

ModuleNotFoundError: No module named 'huggingface_hub'
title = "Clothing item classifier"
description = "A fastai model based classifer that can distinguish between shirts, pants, dresses, and socks."
interpretation = 'default'
enable_queue = True
learn = from_pretrained_fastai("tompham97/clothe-classifier")
labels = learn.dls.vocab
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
/Users/tompham/Document Files/Programming/GitHub/clothing-item-classification/_notebooks/2022-08-02-deploy-app.ipynb Cell 4 in <cell line: 2>()
      <a href='vscode-notebook-cell:/Users/tompham/Document%20Files/Programming/GitHub/clothing-item-classification/_notebooks/2022-08-02-deploy-app.ipynb#ch0000003?line=0'>1</a> #|export
----> <a href='vscode-notebook-cell:/Users/tompham/Document%20Files/Programming/GitHub/clothing-item-classification/_notebooks/2022-08-02-deploy-app.ipynb#ch0000003?line=1'>2</a> learn = from_pretrained_fastai("tompham97/clothe-classifier")
      <a href='vscode-notebook-cell:/Users/tompham/Document%20Files/Programming/GitHub/clothing-item-classification/_notebooks/2022-08-02-deploy-app.ipynb#ch0000003?line=2'>3</a> labels = learn.dls.vocab

NameError: name 'from_pretrained_fastai' is not defined
def classify_image(img):
    pred, idx, probs = learn.predict(img)
    return {labels[i]: float(probs[i]) for i in range(len(labels))}
image = gr.inputs.Image(shape=(192, 192))
label = gr.outputs.Label()
examples = ['dress.webp', 'pants.webp', 'shirt.jpeg', 'socks.jpeg']
intf = gr.Interface(fn=classify_image, inputs=image,
                    outputs=label, title=title,
                    description=description, examples=examples,
                    interpretation=interpretation, enable_queue=enable_queue)
intf.launch()
from nbdev.export import notebook2script
notebook2script('app.ipynb')
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
/Users/tompham/Document Files/Programming/GitHub/clothing-item-classification/_notebooks/2022-08-02-deploy-app.ipynb Cell 8 in <cell line: 2>()
      <a href='vscode-notebook-cell:/Users/tompham/Document%20Files/Programming/GitHub/clothing-item-classification/_notebooks/2022-08-02-deploy-app.ipynb#ch0000007?line=0'>1</a> import fastai
----> <a href='vscode-notebook-cell:/Users/tompham/Document%20Files/Programming/GitHub/clothing-item-classification/_notebooks/2022-08-02-deploy-app.ipynb#ch0000007?line=1'>2</a> from nbdev.export import notebook2script
      <a href='vscode-notebook-cell:/Users/tompham/Document%20Files/Programming/GitHub/clothing-item-classification/_notebooks/2022-08-02-deploy-app.ipynb#ch0000007?line=2'>3</a> notebook2script('app.ipynb')

ImportError: cannot import name 'notebook2script' from 'nbdev.export' (/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/nbdev/export.py)