сделай вывод информации об обучении yolo8 красивым in python

main.py
# Пример вывода информации об обучении модели YOLOv4

from matplotlib import pyplot as plt

# Пример данных о точности и потерях модели
loss = [1.2, 1.0, 0.8, 0.6, 0.4, 0.2, 0.1]
accuracy = [50, 60, 70, 80, 90, 95, 98]
epochs = range(1, len(loss) + 1)

plt.figure(figsize=(10, 5))

# График потерь
plt.subplot(1, 2, 1)
plt.plot(epochs, loss, 'r', label='Loss')
plt.title('Training Loss')
plt.xlabel('Epoch')
plt.ylabel('Loss')
plt.legend()

# График точности
plt.subplot(1, 2, 2)
plt.plot(epochs, accuracy, 'b', label='Accuracy')
plt.title('Training Accuracy')
plt.xlabel('Epoch')
plt.ylabel('Accuracy')
plt.legend()

plt.tight_layout()
plt.show()
648 chars
30 lines

This code snippet provides an example of visualizing training information about a YOLOv4 model in a beautiful way using Python. It uses matplotlib library to create plots for training loss and accuracy over epochs.

gistlibby LogSnag