Image background removal
In this exercise, you will use the same flickr dataset as previously, which has 30,000 images and associated captions. Now you will remove the image background.

The sample image (image) and pipeline module (pipeline) have been loaded.
แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร
Multi-Modal Models with Hugging Face
คำแนะนำการฝึกหัด
- Load the
image-segmentationpipeline with thebriaai/RMBG-1.4pretrained model, andtrust_remote_codeenabled. - Use the pipeline to modify the input
image.
แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ
ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์
# Load the image-segmentation pipeline
pipe = ____
# Use the pipeline to predict the class of the sample image
outputs = ____
plt.imshow(outputs)
plt.show()