MulaiMulai sekarang secara gratis

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.

Photo of 2 people, 1 is playing the guitar

The sample image (image) and pipeline module (pipeline) have been loaded.

Latihan ini adalah bagian dari kursus

Multi-Modal Models with Hugging Face

Lihat Kursus

Petunjuk latihan

  • Load the image-segmentation pipeline with the briaai/RMBG-1.4 pretrained model, and trust_remote_code enabled.
  • Use the pipeline to modify the input image.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Load the image-segmentation pipeline
pipe = ____

# Use the pipeline to predict the class of the sample image
outputs = ____

plt.imshow(outputs)
plt.show()
Edit dan Jalankan Kode