Update inception v3 readme

This commit is contained in:
2024-09-04 21:32:05 +02:00
parent c8bc6f7a39
commit 7b8c4bd811
3 changed files with 56 additions and 10 deletions

View File

@@ -4,14 +4,21 @@ import sys
sys.path.append("../../tools") # Ugly hack
from utils import export_model_weights, print_model_parameters, predict
import torch
if __name__ == "__main__":
weights = torchvision.models.Inception_V3_Weights.DEFAULT
inception = torchvision.models.inception_v3(
weights=torchvision.models.Inception_V3_Weights.DEFAULT
weights=weights,
transform_input=False
)
inception.transform_input = False
inception.eval()
# print_model_parameters(inception) # print layer names and number of parameters
export_model_weights(inception, "inception_v3_weights.bin")
# print(predict(inception, "bird.jpg"))
# class_labels = weights.meta["categories"]
# prediction = predict(inception, "bird.jpg")
# print(prediction, class_labels[prediction])