diff --git a/1.py b/1.py index 1ab77c4..cecbb2b 100644 --- a/1.py +++ b/1.py @@ -1,11 +1,17 @@ -from ultralytics import YOLO +from ultralytics import YOLO,Explorer # Load a pre-trained YOLOv10n model -model = YOLO("./yolov10x.pt") -model.train(data="./dataset.yaml", epochs=3) +# model = YOLO("./yolov10x.pt") +explorer = Explorer(data="./dataset.yaml", model="yolov10x.pt") +explorer.create_embeddings_table() +similar_images_df = explorer.get_similar(img="./1.jpg") +a=explorer.sql_query("WHERE labels LIKE '%person%' AND labels LIKE '%cake%' LIMIT 10") +print(a) +# model.train(data="./dataset.yaml", epochs=3) # Perform object detection on an image -results = model("./1.jpg") - +# results = model("./1.jpg") +# print(results) # Display the results -results[0].show() \ No newline at end of file +# results[0].show() +# results[0].save(filename="result.jpg") # save to disk 保存到磁盘 diff --git a/result.jpg b/result.jpg new file mode 100644 index 0000000..02b53f1 Binary files /dev/null and b/result.jpg differ