
ml: django app folder test: pytorch python code folder --predict.py(model)
And I wanted to use procees function that i made at predcit.py at views.py
process function
def process():
for img_file in os.listdir('C:\\Users\\user\\Desktop\\model\\project\\ml\\test\\images'):
img_path = os.path.join('images', img_file)
predition = predict_breed_transfer(model, img_path)
print(predition)
print("image_file_name: {0}, \t predition breed: {1}\n\n".format(img_path, predition))
return (predition)
views.py at ml folder
from django.shortcuts import render
from .test.predict import *
def predict(request):
pred=process()
return render(request, "predict.html",{'pred':pred})
When i run the server at my local computer, it gets pred as none. I don't understand why views.py doesn't run 'predict_breed_transfer'function...