fffiloni commited on
Commit
cd210ee
·
verified ·
1 Parent(s): 32c9458

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py CHANGED
@@ -272,6 +272,16 @@ def infer(ref_style_file, style_description, caption):
272
  # Reset the state after inference, regardless of success or failure
273
  reset_inference_state()
274
 
 
 
 
 
 
 
 
 
 
 
275
  def infer_compo(style_description, ref_style_file, caption, ref_sub_file):
276
  global models_rbm, models_b
277
  try:
 
272
  # Reset the state after inference, regardless of success or failure
273
  reset_inference_state()
274
 
275
+ def transform(image):
276
+ """
277
+ Define the necessary transformations for the image.
278
+ """
279
+ return T.Compose([
280
+ T.Resize((256, 256)), # Example resize, adjust as needed
281
+ T.ToTensor(),
282
+ T.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
283
+ ])(image)
284
+
285
  def infer_compo(style_description, ref_style_file, caption, ref_sub_file):
286
  global models_rbm, models_b
287
  try: