RamAnanth1 commited on
Commit
98be013
·
1 Parent(s): 474d71a

Add image editing

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -291,7 +291,7 @@ class BLIPVQA:
291
  class ConversationBot:
292
  def __init__(self):
293
  print("Initializing VisualChatGPT")
294
- #self.edit = ImageEditing(device="cuda:0")
295
  self.i2t = ImageCaptioning(device="cuda:0")
296
  self.t2i = T2I(device="cuda:0")
297
  self.image2canny = image2canny()
@@ -306,12 +306,12 @@ class ConversationBot:
306
  Tool(name="Generate Image From User Input Text", func=self.t2i.inference,
307
  description="useful when you want to generate an image from a user input text and save it to a file. like: generate an image of an object or something, or generate an image that includes some objects. "
308
  "The input to this tool should be a string, representing the text used to generate image. "),
309
- #Tool(name="Remove Something From The Photo", func=self.edit.remove_part_of_image,
310
- # description="useful when you want to remove and object or something from the photo from its description or location. "
311
- # "The input to this tool should be a comma seperated string of two, representing the image_path and the object need to be removed. "),
312
- #Tool(name="Replace Something From The Photo", func=self.edit.replace_part_of_image,
313
- # description="useful when you want to replace an object from the object description or location with another object from its description. "
314
- # "The input to this tool should be a comma seperated string of three, representing the image_path, the object to be replaced, the object to be replaced with "),
315
 
316
  #Tool(name="Instruct Image Using Text", func=self.pix2pix.inference,
317
  # description="useful when you want to the style of the image to be like the text. like: make it look like a painting. or make it like a robot. "
 
291
  class ConversationBot:
292
  def __init__(self):
293
  print("Initializing VisualChatGPT")
294
+ self.edit = ImageEditing(device="cuda:0")
295
  self.i2t = ImageCaptioning(device="cuda:0")
296
  self.t2i = T2I(device="cuda:0")
297
  self.image2canny = image2canny()
 
306
  Tool(name="Generate Image From User Input Text", func=self.t2i.inference,
307
  description="useful when you want to generate an image from a user input text and save it to a file. like: generate an image of an object or something, or generate an image that includes some objects. "
308
  "The input to this tool should be a string, representing the text used to generate image. "),
309
+ Tool(name="Remove Something From The Photo", func=self.edit.remove_part_of_image,
310
+ description="useful when you want to remove and object or something from the photo from its description or location. "
311
+ "The input to this tool should be a comma seperated string of two, representing the image_path and the object need to be removed. "),
312
+ Tool(name="Replace Something From The Photo", func=self.edit.replace_part_of_image,
313
+ description="useful when you want to replace an object from the object description or location with another object from its description. "
314
+ "The input to this tool should be a comma seperated string of three, representing the image_path, the object to be replaced, the object to be replaced with "),
315
 
316
  #Tool(name="Instruct Image Using Text", func=self.pix2pix.inference,
317
  # description="useful when you want to the style of the image to be like the text. like: make it look like a painting. or make it like a robot. "