anandhu-pk commited on
Commit
2ce4cd6
·
1 Parent(s): 9185101

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -15,7 +15,7 @@ if task=='Tumor Detection':
15
  # CNN
16
  #with open(r"E:\DUK\DUKSEM3\DEEP_LEARNING\ASSIGN1\Multi-Modal_classifier_Image_Classification_Sentiment_Sentiment_Analysis\CNN\cnn_model.pkl",'rb') as file:
17
  #cnn_model = pickle.load(file)
18
- cnn_model = load_model(r"E:\DUK\DUKSEM3\DEEP_LEARNING\ASSIGN1\Multi-Modal_classifier_Image_Classification_Sentiment_Sentiment_Analysis\CNN\cnn_model1.h5")
19
 
20
  img = st.file_uploader('Upload image', type=['jpeg', 'jpg', 'png'])
21
 
@@ -44,9 +44,9 @@ if task=='Sentiment Classification':
44
 
45
  if arc == arcs[0]:
46
  # Perceptron
47
- with open(r"E:\DUK\DUKSEM3\DEEP_LEARNING\ASSIGN1\Multi-Modal_classifier_Image_Classification_Sentiment_Sentiment_Analysis\Perceptron\pnn_model.pkl",'rb') as file:
48
  perceptron = pickle.load(file)
49
- with open(r"E:\DUK\DUKSEM3\DEEP_LEARNING\ASSIGN1\Multi-Modal_classifier_Image_Classification_Sentiment_Sentiment_Analysis\Perceptron\pnn_tokeniser.pkl",'rb') as file:
50
  ppn_tokeniser = pickle.load(file)
51
 
52
  def ppn_make_predictions(inp, model):
@@ -66,9 +66,9 @@ if task=='Sentiment Classification':
66
 
67
  elif arc == arcs[1]:
68
  # BackPropogation
69
- with open(r"E:\DUK\DUKSEM3\DEEP_LEARNING\ASSIGN1\Multi-Modal_classifier_Image_Classification_Sentiment_Sentiment_Analysis\BackPropagation\bpn_model.pkl",'rb') as file:
70
  backprop = pickle.load(file)
71
- with open(r"E:\DUK\DUKSEM3\DEEP_LEARNING\ASSIGN1\Multi-Modal_classifier_Image_Classification_Sentiment_Sentiment_Analysis\BackPropagation\bpn_tokeniser.pkl",'rb') as file:
72
  bp_tokeniser = pickle.load(file)
73
 
74
  def bp_make_predictions(inp, model):
@@ -89,9 +89,9 @@ if task=='Sentiment Classification':
89
 
90
  elif arc == arcs[2]:
91
  # DNN
92
- with open(r"E:\DUK\DUKSEM3\DEEP_LEARNING\ASSIGN1\Multi-Modal_classifier_Image_Classification_Sentiment_Sentiment_Analysis\DNN\dnn_model.pkl",'rb') as file:
93
  dnn_model = pickle.load(file)
94
- with open(r"E:\DUK\DUKSEM3\DEEP_LEARNING\ASSIGN1\Multi-Modal_classifier_Image_Classification_Sentiment_Sentiment_Analysis\DNN\dnn_tokeniser.pkl",'rb') as file:
95
  dnn_tokeniser = pickle.load(file)
96
 
97
  def dnn_make_predictions(inp, model):
@@ -112,10 +112,10 @@ if task=='Sentiment Classification':
112
 
113
  elif arc == arcs[3]:
114
  # RNN
115
- with open(r"E:\DUK\DUKSEM3\DEEP_LEARNING\ASSIGN1\Multi-Modal_classifier_Image_Classification_Sentiment_Sentiment_Analysis\RNN\rnn_model.pkl",'rb') as file:
116
  rnn_model = pickle.load(file)
117
 
118
- with open(r"E:\DUK\DUKSEM3\DEEP_LEARNING\ASSIGN1\Multi-Modal_classifier_Image_Classification_Sentiment_Sentiment_Analysis\RNN\rnn_tokeniser.pkl",'rb') as file:
119
  rnn_tokeniser = pickle.load(file)
120
 
121
  def rnn_make_predictions(inp, model):
@@ -136,10 +136,10 @@ if task=='Sentiment Classification':
136
 
137
  elif arc == arcs[4]:
138
  # LSTM
139
- with open(r"E:\DUK\DUKSEM3\DEEP_LEARNING\ASSIGN1\Multi-Modal_classifier_Image_Classification_Sentiment_Sentiment_Analysis\LSTM\lstm_model.pkl",'rb') as file:
140
  lstm_model = pickle.load(file)
141
 
142
- with open(r"E:\DUK\DUKSEM3\DEEP_LEARNING\ASSIGN1\Multi-Modal_classifier_Image_Classification_Sentiment_Sentiment_Analysis\LSTM\lstm_tokeniser.pkl",'rb') as file:
143
  lstm_tokeniser = pickle.load(file)
144
 
145
  def lstm_make_predictions(inp, model):
 
15
  # CNN
16
  #with open(r"E:\DUK\DUKSEM3\DEEP_LEARNING\ASSIGN1\Multi-Modal_classifier_Image_Classification_Sentiment_Sentiment_Analysis\CNN\cnn_model.pkl",'rb') as file:
17
  #cnn_model = pickle.load(file)
18
+ cnn_model = load_model("cnn_model1.h5")
19
 
20
  img = st.file_uploader('Upload image', type=['jpeg', 'jpg', 'png'])
21
 
 
44
 
45
  if arc == arcs[0]:
46
  # Perceptron
47
+ with open("pnn_model.pkl",'rb') as file:
48
  perceptron = pickle.load(file)
49
+ with open("pnn_tokeniser.pkl",'rb') as file:
50
  ppn_tokeniser = pickle.load(file)
51
 
52
  def ppn_make_predictions(inp, model):
 
66
 
67
  elif arc == arcs[1]:
68
  # BackPropogation
69
+ with open("bpn_model.pkl",'rb') as file:
70
  backprop = pickle.load(file)
71
+ with open("bpn_tokeniser.pkl",'rb') as file:
72
  bp_tokeniser = pickle.load(file)
73
 
74
  def bp_make_predictions(inp, model):
 
89
 
90
  elif arc == arcs[2]:
91
  # DNN
92
+ with open("dnn_model.pkl",'rb') as file:
93
  dnn_model = pickle.load(file)
94
+ with open("dnn_tokeniser.pkl",'rb') as file:
95
  dnn_tokeniser = pickle.load(file)
96
 
97
  def dnn_make_predictions(inp, model):
 
112
 
113
  elif arc == arcs[3]:
114
  # RNN
115
+ with open("rnn_model.pkl",'rb') as file:
116
  rnn_model = pickle.load(file)
117
 
118
+ with open("rnn_tokeniser.pkl",'rb') as file:
119
  rnn_tokeniser = pickle.load(file)
120
 
121
  def rnn_make_predictions(inp, model):
 
136
 
137
  elif arc == arcs[4]:
138
  # LSTM
139
+ with open("lstm_model.pkl",'rb') as file:
140
  lstm_model = pickle.load(file)
141
 
142
+ with open("lstm_tokeniser.pkl",'rb') as file:
143
  lstm_tokeniser = pickle.load(file)
144
 
145
  def lstm_make_predictions(inp, model):