← Computer Vision for EveryoneToolsInVisionLearning Center
Image Segmentation · Lesson 58

Separate Instances of the Same Class

Two tree canopies touch, but the city needs separate tree counts.

Read the full lesson and open its transcript below. A narrated video will be added after production.

Lesson overview

What you will learn

Two tree canopies touch, but the city needs separate tree counts.

  1. A practical question
  2. The useful idea
  3. Work through the example
  4. Limits and next step
01

A practical question

Two trees touch overhead. A semantic map correctly labels all their visible leaves as tree, but it doesn't tell us which pixels belong to which tree. Instance segmentation assigns a separate object identity to each region as well as its class.

02

The useful idea

That distinction matters if the city wants a count or an area for each tree. At overlapping branches, even human annotators may disagree about ownership. Define the visible-object rule and mark uncertain boundaries rather than pretending the camera sees hidden trunks.

03

Work through the example

Compare a semantic tree mask with two instance masks on the same photograph. Does the split follow visible evidence, or is it an arbitrary vertical line? Inspect isolated trees and overlapping ones before choosing a method. Two tree canopies touch in the image, but a city inventory may need a separate count and area for each tree. Compare a single semantic tree mask with two instance masks. If a dividing line runs through foliage without visible evidence, acknowledge the ambiguity instead of claiming a perfect separation. Look for trunk and branch context where it is visible. An instance identity is useful for counting, but it is still an interpretation of a partly hidden scene. Now check the idea on a concrete example: Compare one semantic tree mask with two separate instance masks on the same photograph. This supports a careful conclusion: Instance segmentation separates object identities even if both share the same semantic class. At the point where canopies overlap, two plausible instance boundaries may exist. Inspect trunk locations or a second view if available, and label the unresolved region consistently. The city still gets a count, but it should know where the image alone cannot settle ownership.

04

Limits and next step

Now that we have masks for individual objects, we'll evaluate both their overlap and their boundary quality.

Worked example

Compare one semantic tree mask with two separate instance masks on the same photograph.

Knowledge check

Quick check: test your understanding

Try it yourself: Consider this case: Compare one semantic tree mask with two separate instance masks on the same photograph. Explain how you would check the result. In your answer, address this limitation: An instance ID is an annotation choice and can be ambiguous at heavy occlusion.

Check the reasoning

Instance segmentation separates object identities even if both share the same semantic class. An instance ID is an annotation choice and can be ambiguous at heavy occlusion.

What is the main idea behind separate instances of the same class?

Instance segmentation separates object identities even if both share the same semantic class.

How is it used in the example?

Compare one semantic tree mask with two separate instance masks on the same photograph.

What limitation should be checked?

An instance ID is an annotation choice and can be ambiguous at heavy occlusion.

Further reading

Programming Computer Vision with Python — Jan Erik Solem.

Original ToolsInVision teaching examples. Editorial approach · Suggest a correction

Accessible referenceLesson 58 transcript297 words · Narration ready for the upcoming videoOpen transcript

Two trees touch overhead. A semantic map correctly labels all their visible leaves as tree, but it doesn't tell us which pixels belong to which tree. Instance segmentation assigns a separate object identity to each region as well as its class.

That distinction matters if the city wants a count or an area for each tree. At overlapping branches, even human annotators may disagree about ownership. Define the visible-object rule and mark uncertain boundaries rather than pretending the camera sees hidden trunks.

Compare a semantic tree mask with two instance masks on the same photograph. Does the split follow visible evidence, or is it an arbitrary vertical line? Inspect isolated trees and overlapping ones before choosing a method. Two tree canopies touch in the image, but a city inventory may need a separate count and area for each tree. Compare a single semantic tree mask with two instance masks. If a dividing line runs through foliage without visible evidence, acknowledge the ambiguity instead of claiming a perfect separation. Look for trunk and branch context where it is visible. An instance identity is useful for counting, but it is still an interpretation of a partly hidden scene. Now check the idea on a concrete example: Compare one semantic tree mask with two separate instance masks on the same photograph. This supports a careful conclusion: Instance segmentation separates object identities even if both share the same semantic class. At the point where canopies overlap, two plausible instance boundaries may exist. Inspect trunk locations or a second view if available, and label the unresolved region consistently. The city still gets a count, but it should know where the image alone cannot settle ownership.

Now that we have masks for individual objects, we'll evaluate both their overlap and their boundary quality.