Ryukijano commited on
Commit
bdfe3b8
·
verified ·
1 Parent(s): 5ecdeb3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -20,8 +20,8 @@ vision_model = MllamaForConditionalGeneration.from_pretrained(
20
  )
21
  processor = AutoProcessor.from_pretrained(llama_vision_model_id, token=hf_token)
22
 
23
- # Set up segmentation model using Segment Anything 2 from Hugging Face Hub
24
- segment_model_id = "camenduru/segment-anything-2"
25
  segment_pipe = pipeline(
26
  "image-segmentation",
27
  model=segment_model_id,
@@ -45,7 +45,7 @@ def process_image(image):
45
  output = vision_model.generate(**inputs, max_new_tokens=50)
46
  caption = processor.decode(output[0], skip_special_tokens=True)
47
 
48
- # Step 2: Segment important parts of the image using Segment Anything 2
49
  segmented_result = segment_pipe(image=image)
50
  segments = segmented_result
51
 
 
20
  )
21
  processor = AutoProcessor.from_pretrained(llama_vision_model_id, token=hf_token)
22
 
23
+ # Set up segmentation model using MaskFormer Swin Large from Hugging Face Hub
24
+ segment_model_id = "facebook/maskformer-swin-large"
25
  segment_pipe = pipeline(
26
  "image-segmentation",
27
  model=segment_model_id,
 
45
  output = vision_model.generate(**inputs, max_new_tokens=50)
46
  caption = processor.decode(output[0], skip_special_tokens=True)
47
 
48
+ # Step 2: Segment important parts of the image using MaskFormer Swin Large
49
  segmented_result = segment_pipe(image=image)
50
  segments = segmented_result
51