first commit

This commit is contained in:
scott committed 2026-09-16 14:23:43 -05:00
commit a9a3f2142b
9 files changed
+37

No files matched your search

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Executable
+7
View File
@@ -0,0 +1,7 @@
it works on pictures of busses but not the hand-drawn image i made.
This program tells you whether or not the selected image is a bus.
python3 test.py
To change the file to run the operation on, change this line in the source code: results = model("bus4.jpg")
+30
View File
@@ -0,0 +1,30 @@
from ultralytics import YOLO
# Load the small pretrained YOLOv8 object-detection model.
model = YOLO("yolov8n.pt")
# Run object detection on a test image.
results = model("bus4.jpg")
has_bus = False
max_confidence = 0.0
for result in results:
class_names = result.names
detected_classes = result.boxes.cls.tolist()
confidences = result.boxes.conf.tolist()
# Check each detected object and its matching confidence score
for cls_id, conf in zip(detected_classes, confidences):
if class_names[int(cls_id)] == "bus":
has_bus = True
# Keep track of the highest confidence if there are multiple buses
if conf > max_confidence:
max_confidence = conf
# Output the Yes/No answer and the confidence percentage
if has_bus:
print("Yes")
print(f"Confidence: {max_confidence * 100:.1f}%")
else:
print("No")
BIN
View File
Binary file not shown.