Falah commited on
Commit
558764d
1 Parent(s): 39af5fa
Files changed (1) hide show
  1. app.py +17 -2
app.py CHANGED
@@ -13,7 +13,7 @@ def detect_and_visualize_objects(image):
13
  # Process the image using the object detection model
14
  predictions = detector(
15
  image,
16
- candidate_labels=["human face", "rocket", "nasa badge", "star-spangled banner"],
17
  )
18
 
19
  # Draw bounding boxes and labels on the image
@@ -33,13 +33,28 @@ def detect_and_visualize_objects(image):
33
  # Define the Gradio interface
34
  image_input = gr.inputs.Image(type="pil")
35
  image_output = gr.outputs.Image(type="pil")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
 
37
  iface = gr.Interface(
38
  fn=detect_and_visualize_objects,
39
  inputs=image_input,
40
  outputs=image_output,
41
- title="Object Detection",
42
  description="Detect objects in an image using a pre-trained model and visualize the results.",
 
43
  )
44
 
45
  # Launch the Gradio interface
 
13
  # Process the image using the object detection model
14
  predictions = detector(
15
  image,
16
+ candidate_labels=["human face", "rocket"],
17
  )
18
 
19
  # Draw bounding boxes and labels on the image
 
33
  # Define the Gradio interface
34
  image_input = gr.inputs.Image(type="pil")
35
  image_output = gr.outputs.Image(type="pil")
36
+ articles = [
37
+ gr.Article(
38
+ title="Introduction to Text Generation",
39
+ content="Text generation is the process of creating natural language text using computational methods. It is a subfield of natural language processing and has applications in various domains such as chatbots, language translation, and creative writing.",
40
+ ),
41
+ gr.Article(
42
+ title="GPT-2 Model",
43
+ content="GPT-2 (Generative Pre-trained Transformer 2) is a state-of-the-art language model developed by OpenAI. It is trained on a massive amount of text data and can generate coherent and contextually relevant text based on a given prompt.",
44
+ ),
45
+ gr.Article(
46
+ title="How to Use",
47
+ content="To generate text, simply enter a prompt in the text input box and click the 'Generate' button. The model will then generate multiple text outputs based on the prompt. You can experiment with different prompts to see how the generated text changes.",
48
+ ),
49
+ ]
50
 
51
  iface = gr.Interface(
52
  fn=detect_and_visualize_objects,
53
  inputs=image_input,
54
  outputs=image_output,
55
+ title="Space and War Missile Detection System ",
56
  description="Detect objects in an image using a pre-trained model and visualize the results.",
57
+ articles=articles
58
  )
59
 
60
  # Launch the Gradio interface