CG commited on
Commit ·
0444951
1
Parent(s): 38b2eeb
Removed mps
Browse files
app.py
CHANGED
|
@@ -10,7 +10,6 @@ from transformers import (AutoConfig, AutoModelForObjectDetection, AutoImageProc
|
|
| 10 |
from PIL import Image, ImageDraw, ImageFont
|
| 11 |
import pkgutil
|
| 12 |
|
| 13 |
-
|
| 14 |
# Load dataset from Hugging Face
|
| 15 |
dataset1 = load_dataset("gcesar/spinach", download_mode="force_redownload")
|
| 16 |
dataset2 = load_dataset("gcesar/spinach_augment", download_mode="force_redownload")
|
|
@@ -30,16 +29,16 @@ dataset2 = load_dataset("gcesar/spinach_augment", download_mode="force_redownloa
|
|
| 30 |
# torch.backends.mps.is_built()
|
| 31 |
|
| 32 |
# Assign GPU
|
| 33 |
-
device = torch.device("mps")
|
| 34 |
|
| 35 |
# Use GPU
|
| 36 |
# .to(device)
|
| 37 |
# pipeline(device=device)
|
| 38 |
|
| 39 |
# Create pipeline model
|
| 40 |
-
|
| 41 |
# Create pipeline model with mps
|
| 42 |
-
pipe = pipeline(task="object-detection", model="haiquanua/weed_detr", device=device, trust_remote_code=True, force_download=True)
|
| 43 |
|
| 44 |
# repo_path="haiquanua/weed_swin"
|
| 45 |
#
|
|
|
|
| 10 |
from PIL import Image, ImageDraw, ImageFont
|
| 11 |
import pkgutil
|
| 12 |
|
|
|
|
| 13 |
# Load dataset from Hugging Face
|
| 14 |
dataset1 = load_dataset("gcesar/spinach", download_mode="force_redownload")
|
| 15 |
dataset2 = load_dataset("gcesar/spinach_augment", download_mode="force_redownload")
|
|
|
|
| 29 |
# torch.backends.mps.is_built()
|
| 30 |
|
| 31 |
# Assign GPU
|
| 32 |
+
# device = torch.device("mps")
|
| 33 |
|
| 34 |
# Use GPU
|
| 35 |
# .to(device)
|
| 36 |
# pipeline(device=device)
|
| 37 |
|
| 38 |
# Create pipeline model
|
| 39 |
+
pipe = pipeline(task="object-detection", model="haiquanua/weed_detr", trust_remote_code=True, force_download=True)
|
| 40 |
# Create pipeline model with mps
|
| 41 |
+
#pipe = pipeline(task="object-detection", model="haiquanua/weed_detr", device=device, trust_remote_code=True, force_download=True)
|
| 42 |
|
| 43 |
# repo_path="haiquanua/weed_swin"
|
| 44 |
#
|