from yolo import YOLO
yolo = YOLO()
image_path = "foto.png"
detections = yolo.predict(image_path)
for detection in detections:
print(detection)
dict = {
"a": [131, 531],
"b": [842, 612],
"c": [516, 19]
}
float_nums = []
for value in dict.values():
for num in value:
float_nums.append(float(num))
a = min(float_nums)
b = max(float_nums)
a_index = []
b_index = []
for key, values in dict.items():
if a in values:
a_index.append(key)
a_index.append(values.index(a))
if b in values:
b_index.append(key)
b_index.append(values.index(b))
print(a, *a_index)
print(b, *b_index)
a = {
"a": "1",
"b": "2",
"dict2": {
"c": "3",
"d": "4",
}
}
def find_dict(d):
for x, y in d.items():
if isinstance(y, dict):
return x
return None
print(find_dict(a))