Spaces:
Sleeping
Sleeping
Commit
·
d87e79e
1
Parent(s):
454c914
fix
Browse files
app.py
CHANGED
|
@@ -3,11 +3,8 @@ from transformers import pipeline
|
|
| 3 |
from datasets import load_dataset
|
| 4 |
|
| 5 |
|
| 6 |
-
def load_my_dataset():
|
| 7 |
-
dataset = load_dataset("Avmromanov/tripoexamples")
|
| 8 |
-
return dataset
|
| 9 |
-
|
| 10 |
def get_dataset_examples(dataset):
|
|
|
|
| 11 |
train_data = dataset['train']
|
| 12 |
example_ids = [0, 3, 6]
|
| 13 |
|
|
@@ -18,9 +15,6 @@ def get_dataset_examples(dataset):
|
|
| 18 |
|
| 19 |
return examples
|
| 20 |
|
| 21 |
-
car_classifier = pipeline("image-classification",
|
| 22 |
-
model="dima806/car_models_image_detection")
|
| 23 |
-
|
| 24 |
def identify_car(image):
|
| 25 |
if image.mode != 'RGB':
|
| 26 |
image = image.convert('RGB')
|
|
@@ -40,8 +34,8 @@ def identify_car(image):
|
|
| 40 |
|
| 41 |
return result_text
|
| 42 |
|
| 43 |
-
|
| 44 |
-
dataset_examples = get_dataset_examples(
|
| 45 |
|
| 46 |
with gr.Blocks() as demo:
|
| 47 |
gr.Markdown("# Car Identifier with My Dataset")
|
|
|
|
| 3 |
from datasets import load_dataset
|
| 4 |
|
| 5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
def get_dataset_examples(dataset):
|
| 7 |
+
dataset = load_dataset("Avmromanov/tripoexamples")
|
| 8 |
train_data = dataset['train']
|
| 9 |
example_ids = [0, 3, 6]
|
| 10 |
|
|
|
|
| 15 |
|
| 16 |
return examples
|
| 17 |
|
|
|
|
|
|
|
|
|
|
| 18 |
def identify_car(image):
|
| 19 |
if image.mode != 'RGB':
|
| 20 |
image = image.convert('RGB')
|
|
|
|
| 34 |
|
| 35 |
return result_text
|
| 36 |
|
| 37 |
+
car_classifier = pipeline("image-classification", model="dima806/car_models_image_detection")
|
| 38 |
+
dataset_examples = get_dataset_examples()
|
| 39 |
|
| 40 |
with gr.Blocks() as demo:
|
| 41 |
gr.Markdown("# Car Identifier with My Dataset")
|