Phauglin commited on
Commit
5c93b6c
·
verified ·
1 Parent(s): 69de931

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -15
app.py CHANGED
@@ -49,21 +49,20 @@ def process_image(img):
49
  wiki_url = search_terms_wikipedia.get(predicted_class, "No Wikipedia entry found.")
50
 
51
  # Generate FLUX image
52
- with gr.Status("Generating AI image based on classification..."):
53
- result = fal_client.subscribe(
54
- "fal-ai/flux/schnell",
55
- arguments={
56
- "prompt": f"A detailed, artistic interpretation of {predicted_class} flower in natural setting",
57
- "image_size": "256x256" # Low res for testing
58
- },
59
- with_logs=True,
60
- on_queue_update=on_queue_update,
61
- )
62
-
63
- # Convert the image data
64
- image_data = base64.b64decode(result['image'])
65
- generated_image = Image.open(io.BytesIO(image_data))
66
-
67
  return classification_results, generated_image, wiki_url
68
 
69
  # Load the learner
 
49
  wiki_url = search_terms_wikipedia.get(predicted_class, "No Wikipedia entry found.")
50
 
51
  # Generate FLUX image
52
+ result = fal_client.subscribe(
53
+ "fal-ai/flux/schnell",
54
+ arguments={
55
+ "prompt": f"A detailed, artistic interpretation of {predicted_class} flower in natural setting",
56
+ "image_size": "256x256" # Low res for testing
57
+ },
58
+ with_logs=True,
59
+ on_queue_update=on_queue_update,
60
+ )
61
+
62
+ # Convert the image data
63
+ image_data = base64.b64decode(result['image'])
64
+ generated_image = Image.open(io.BytesIO(image_data))
65
+
 
66
  return classification_results, generated_image, wiki_url
67
 
68
  # Load the learner