forked from scott/YOLOv8_test_example
Compare commits
2
Commits
c590b6bb4b
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
01ee36174b | ||
|
|
f2cc5c141e |
@@ -1,7 +1,65 @@
|
|||||||
it works on pictures of busses but not the hand-drawn image i made.
|
# test
|
||||||
|
|
||||||
This program tells you whether or not the selected image is a bus.
|
outputs `Yes` if the supplied image contains a bus and `No` if it does not
|
||||||
|
|
||||||
python3 test.py
|
## usage
|
||||||
|
|
||||||
To change the file to run the operation on, change this line in the source code: results = model("bus4.jpg")
|
syntax: `./test.py [IMAGE]`
|
||||||
|
|
||||||
|
### example 1
|
||||||
|
|
||||||
|
testing with the following image:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
```bash
|
||||||
|
./test.py img/bus.jpg
|
||||||
|
```
|
||||||
|
|
||||||
|
output:
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
image 1/1 /home/ja/git/YOLOv8_test_example/img/bus.jpg: 640x480 4 persons, 1 bus, 1 stop sign, 20.1ms
|
||||||
|
Speed: 1.0ms preprocess, 20.1ms inference, 0.7ms postprocess per image at shape (1, 3, 640, 480)
|
||||||
|
Yes
|
||||||
|
Confidence: 87.3%
|
||||||
|
```
|
||||||
|
|
||||||
|
### example 2
|
||||||
|
|
||||||
|
testing with the following image:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
```bash
|
||||||
|
./test.py img/notabus.png
|
||||||
|
```
|
||||||
|
|
||||||
|
output:
|
||||||
|
|
||||||
|
```
|
||||||
|
image 1/1 /home/ja/git/YOLOv8_test_example/img/notabus.png: 384x640 (no detections), 17.4ms
|
||||||
|
Speed: 0.9ms preprocess, 17.4ms inference, 0.4ms postprocess per image at shape (1, 3, 384, 640)
|
||||||
|
No
|
||||||
|
```
|
||||||
|
|
||||||
|
### example 3
|
||||||
|
|
||||||
|
testing with the following image:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
```bash
|
||||||
|
./test.py img/bus2.png
|
||||||
|
```
|
||||||
|
|
||||||
|
output:
|
||||||
|
|
||||||
|
```
|
||||||
|
image 1/1 /home/ja/git/YOLOv8_test_example/img/bus2.png: 384x640 (no detections), 16.4ms
|
||||||
|
Speed: 1.1ms preprocess, 16.4ms inference, 0.3ms postprocess per image at shape (1, 3, 384, 640)
|
||||||
|
No
|
||||||
|
```
|
||||||
|
|
||||||
|
Note that another cartoon image of a bus did register as a bus.
|
||||||
Reference in new issue
Block a user