warhawkmonk commited on
Commit
40766cb
·
verified ·
1 Parent(s): 4947b21

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -16
app.py CHANGED
@@ -73,7 +73,7 @@ def model_out_put(init_image,mask_image,prompt,negative_prompt):
73
 
74
  @st.cache_resource
75
  def multimodel():
76
- pipeline_ = pipeline("text-classification", model = "model_collection\model_4")
77
  return pipeline_
78
 
79
  def multimodel_output(prompt):
@@ -126,7 +126,7 @@ bg_color = "#eee"
126
 
127
  column1,column2=st.columns([0.7,0.35])
128
 
129
- with open("\home\user\DataBase\datetimeRecords.json","r") as read:
130
  dateTimeRecord=json.load(read)
131
  with column2:
132
  st.header("HISTORY")
@@ -137,7 +137,7 @@ with column2:
137
 
138
  if not len(dictionary['every_prompt_with_val']):
139
  st.header("I will store all the chat for the current session")
140
- with open("lotte_animation_saver\\animation_4.json") as read:
141
  url_json=json.load(read)
142
  st_lottie(url_json,height = 400)
143
  else:
@@ -163,7 +163,7 @@ with column2:
163
  with st.container(height=400):
164
  format1,format2=st.columns([0.2,0.8])
165
  with format1:
166
- new_img=Image.open("ALL_image_formation\image_gen.png")
167
  st.write("<br>",unsafe_allow_html=True)
168
  size = min(new_img.size)
169
  mask = Image.new('L', (size, size), 0)
@@ -208,7 +208,7 @@ with column2:
208
  else:
209
 
210
  st.header("This section will store the updated images")
211
- with open("lotte_animation_saver\\animation_1.json") as read:
212
  url_json=json.load(read)
213
  st_lottie(url_json,height = 400)
214
  with tab3:
@@ -225,7 +225,7 @@ with column2:
225
  else:
226
 
227
  st.header("This section will provide prompt improvement section")
228
- with open("lotte_animation_saver\\animation_3.json") as read:
229
  url_json=json.load(read)
230
  st_lottie(url_json,height = 400)
231
  with tab4:
@@ -235,7 +235,7 @@ with column2:
235
  if not dictionary['user'] :
236
  with st.form("my_form"):
237
  # st.header("Please login for save your data")
238
- with open("lotte_animation_saver\\animation_5.json") as read:
239
  url_json=json.load(read)
240
  st_lottie(url_json,height = 200)
241
  user_id = st.text_input("user login")
@@ -244,7 +244,7 @@ with column2:
244
  # Every form must have a submit button.
245
 
246
  if submitted_login:
247
- with open("DataBase\login.json","r") as read:
248
  login_base=json.load(read)
249
  if user_id in login_base and login_base[user_id]==password:
250
  dictionary['user']=user_id
@@ -270,7 +270,7 @@ with column2:
270
  with st.form("my_form1"):
271
  sign_up_column_left,sign_up_column_right=st.columns(2)
272
  with sign_up_column_left:
273
- with open("lotte_animation_saver\\animation_6.json") as read:
274
  url_json=json.load(read)
275
  st_lottie(url_json,height = 200)
276
 
@@ -280,13 +280,13 @@ with column2:
280
  submitted_signup = st.form_submit_button("Submit")
281
 
282
  if submitted_signup:
283
- with open("DataBase\login.json","r") as read:
284
  login_base=json.load(read)
285
  if not login_base:
286
  login_base={}
287
  if user_id not in login_base:
288
  login_base[user_id]=password
289
- with open("DataBase\login.json","w") as write:
290
  json.dump(login_base,write,indent=2)
291
  st.success("you are a part now")
292
  dictionary['user']=user_id
@@ -297,7 +297,7 @@ with column2:
297
  st.header("REPORTED ISSUES")
298
  with st.container(height=370):
299
 
300
- with open("DataBase\datetimeRecords.json") as feedback:
301
  temp_issue=json.load(feedback)
302
 
303
  arranged_feedback=reversed(temp_issue['database'])
@@ -313,12 +313,12 @@ with column2:
313
  feedback=st.text_area("Feedback Report and Improvement",placeholder="")
314
  summit=st.button("submit")
315
  if summit:
316
- with open("DataBase\datetimeRecords.json","r") as feedback_sumit:
317
  temp_issue_submit=json.load(feedback_sumit)
318
  if "database" not in temp_issue_submit:
319
  temp_issue_submit["database"]=[]
320
  temp_issue_submit["database"].append((str(datetime.now()),feedback,dictionary['user']))
321
- with open("DataBase\datetimeRecords.json","w") as feedback_sumit:
322
  json.dump(temp_issue_submit,feedback_sumit)
323
 
324
 
@@ -405,7 +405,7 @@ if canvas_result.image_data is not None:
405
  with open("lotte_animation_saver/animation_4.json") as read:
406
  url_json=json.load(read)
407
  st_lottie(url_json)
408
- imf=Image.open("ALL_image_formation\home_screen.jpg").resize(new_size)
409
  else:
410
  if len(dictionary['current_image'])!=0:
411
  imf=dictionary['current_image'][0]
@@ -413,7 +413,7 @@ if canvas_result.image_data is not None:
413
  with open("lotte_animation_saver/animation_4.json") as read:
414
  url_json=json.load(read)
415
  st_lottie(url_json)
416
- imf=Image.open("ALL_image_formation\home_screen.jpg")
417
 
418
  negative_image =d4_to_3d(np.array(canvas_result.image_data))
419
  if np.sum(negative_image)==0:
 
73
 
74
  @st.cache_resource
75
  def multimodel():
76
+ pipeline_ = pipeline("text-classification", model = "model_collection/model_4")
77
  return pipeline_
78
 
79
  def multimodel_output(prompt):
 
126
 
127
  column1,column2=st.columns([0.7,0.35])
128
 
129
+ with open("/home/user/DataBase/datetimeRecords.json","r") as read:
130
  dateTimeRecord=json.load(read)
131
  with column2:
132
  st.header("HISTORY")
 
137
 
138
  if not len(dictionary['every_prompt_with_val']):
139
  st.header("I will store all the chat for the current session")
140
+ with open("lotte_animation_saver/animation_4.json") as read:
141
  url_json=json.load(read)
142
  st_lottie(url_json,height = 400)
143
  else:
 
163
  with st.container(height=400):
164
  format1,format2=st.columns([0.2,0.8])
165
  with format1:
166
+ new_img=Image.open("ALL_image_formation/image_gen.png")
167
  st.write("<br>",unsafe_allow_html=True)
168
  size = min(new_img.size)
169
  mask = Image.new('L', (size, size), 0)
 
208
  else:
209
 
210
  st.header("This section will store the updated images")
211
+ with open("lotte_animation_saver/animation_1.json") as read:
212
  url_json=json.load(read)
213
  st_lottie(url_json,height = 400)
214
  with tab3:
 
225
  else:
226
 
227
  st.header("This section will provide prompt improvement section")
228
+ with open("lotte_animation_saver/animation_3.json") as read:
229
  url_json=json.load(read)
230
  st_lottie(url_json,height = 400)
231
  with tab4:
 
235
  if not dictionary['user'] :
236
  with st.form("my_form"):
237
  # st.header("Please login for save your data")
238
+ with open("lotte_animation_saver/animation_5.json") as read:
239
  url_json=json.load(read)
240
  st_lottie(url_json,height = 200)
241
  user_id = st.text_input("user login")
 
244
  # Every form must have a submit button.
245
 
246
  if submitted_login:
247
+ with open("DataBase/login.json","r") as read:
248
  login_base=json.load(read)
249
  if user_id in login_base and login_base[user_id]==password:
250
  dictionary['user']=user_id
 
270
  with st.form("my_form1"):
271
  sign_up_column_left,sign_up_column_right=st.columns(2)
272
  with sign_up_column_left:
273
+ with open("lotte_animation_saver/animation_6.json") as read:
274
  url_json=json.load(read)
275
  st_lottie(url_json,height = 200)
276
 
 
280
  submitted_signup = st.form_submit_button("Submit")
281
 
282
  if submitted_signup:
283
+ with open("DataBase/login.json","r") as read:
284
  login_base=json.load(read)
285
  if not login_base:
286
  login_base={}
287
  if user_id not in login_base:
288
  login_base[user_id]=password
289
+ with open("DataBase/login.json","w") as write:
290
  json.dump(login_base,write,indent=2)
291
  st.success("you are a part now")
292
  dictionary['user']=user_id
 
297
  st.header("REPORTED ISSUES")
298
  with st.container(height=370):
299
 
300
+ with open("DataBase/datetimeRecords.json") as feedback:
301
  temp_issue=json.load(feedback)
302
 
303
  arranged_feedback=reversed(temp_issue['database'])
 
313
  feedback=st.text_area("Feedback Report and Improvement",placeholder="")
314
  summit=st.button("submit")
315
  if summit:
316
+ with open("DataBase/datetimeRecords.json","r") as feedback_sumit:
317
  temp_issue_submit=json.load(feedback_sumit)
318
  if "database" not in temp_issue_submit:
319
  temp_issue_submit["database"]=[]
320
  temp_issue_submit["database"].append((str(datetime.now()),feedback,dictionary['user']))
321
+ with open("DataBase/datetimeRecords.json","w") as feedback_sumit:
322
  json.dump(temp_issue_submit,feedback_sumit)
323
 
324
 
 
405
  with open("lotte_animation_saver/animation_4.json") as read:
406
  url_json=json.load(read)
407
  st_lottie(url_json)
408
+ imf=Image.open("ALL_image_formation/home_screen.jpg").resize(new_size)
409
  else:
410
  if len(dictionary['current_image'])!=0:
411
  imf=dictionary['current_image'][0]
 
413
  with open("lotte_animation_saver/animation_4.json") as read:
414
  url_json=json.load(read)
415
  st_lottie(url_json)
416
+ imf=Image.open("ALL_image_formation/home_screen.jpg")
417
 
418
  negative_image =d4_to_3d(np.array(canvas_result.image_data))
419
  if np.sum(negative_image)==0: