10
11
12def clean_graph_dir():
13 os.system("rm -rf /home/linuxsagar/PycharmProjects/FruitClassifierTesting/FCTesting/static/histo.png")14
15
16def make_histogram(i_hist, i_hufe, i_ehfe, i_hhfe, dataDir):
11 # shutil.rmtree('/home/linuxsagar/PycharmProjects/FruitClassifierTesting/graphs/')
12 # os.mkdir('')
13 # os.remove()
14 os.system("rm -rf /home/linuxsagar/PycharmProjects/FruitClassifierTesting/FCTesting/static/histo.png")
60 probability = np.amax(classifier.predict_proba(_new_features))
61
62 # Call method to generate histogram image
63 make_histogram(_custom_image.histogram(), _newHhfe, _newEhfe, _newHaarfe, dataDir)64
65 # The Final result to view
66 result = [
64
65 # The Final result to view
66 result = [
67 f"The given input is classified as: {classifier.predict(_new_features)[0]}.",68 f"Probability of prediction: {probability:.1}%"]
69
70 return [result, hue_data, edge_data, haar_data]
37def predict():
38 data = predictor()
39 MainServices.clean_dir()
40 return render_template('index.html', result=data[0], hue=data[1], edge=data[2], haar=data[3])41
42
43@app.errorhandler(Exception)
Line length greater than configured max_line_length
detected, defaults to 79 character. This limit can be configured docs