Update app.py
Browse files
app.py
CHANGED
|
@@ -1,17 +1,10 @@
|
|
| 1 |
-
from huggingface_hub import from_pretrained_fastai
|
| 2 |
import gradio as gr
|
| 3 |
-
from fastai.vision.all import *
|
| 4 |
from icevision.all import *
|
| 5 |
|
| 6 |
-
# repo_id = "YOUR_USERNAME/YOUR_LEARNER_NAME"
|
| 7 |
-
# repo_id = "igmarco/raccoon-image-detection"
|
| 8 |
-
|
| 9 |
model1 = models.torchvision.faster_rcnn.model(backbone=models.torchvision.faster_rcnn.backbones.resnet18_fpn, num_classes=len(class_map))
|
| 10 |
state_dict = torch.load('fasterRCNN_resnet18_Raccoons.pth')
|
| 11 |
model1.load_state_dict(state_dict)
|
| 12 |
|
| 13 |
-
# model1 = from_pretrained_fastai(repo_id)
|
| 14 |
-
|
| 15 |
def show_preds(input_image, display_label, display_bbox, detection_threshold):
|
| 16 |
|
| 17 |
if detection_threshold==0: detection_threshold=0.5
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
from icevision.all import *
|
| 3 |
|
|
|
|
|
|
|
|
|
|
| 4 |
model1 = models.torchvision.faster_rcnn.model(backbone=models.torchvision.faster_rcnn.backbones.resnet18_fpn, num_classes=len(class_map))
|
| 5 |
state_dict = torch.load('fasterRCNN_resnet18_Raccoons.pth')
|
| 6 |
model1.load_state_dict(state_dict)
|
| 7 |
|
|
|
|
|
|
|
| 8 |
def show_preds(input_image, display_label, display_bbox, detection_threshold):
|
| 9 |
|
| 10 |
if detection_threshold==0: detection_threshold=0.5
|