Background: In the semiconductor industry, accurate and fast segmentation and metrology on scanning electron microscopy (SEM) and transmission electron microscopy (TEM) images are critical for analyzing complex structures. Traditional image analysis often struggles with low contrast, weak or ambiguous boundaries, and the need to distinguish multiple materials within an object.Aim: To address these challenges, we present a deep-learning approach that improves segmentation accuracy and automates metrology for inner and outer objects at advanced manufacturing steps.Approach: We fine-tune the OneFormer architecture with domain-specific adaptations: (i) a combined loss (Boundary, Dice, Binary Cross-Entropy) to sharpen edges and balance classes; (ii) a two-stage training schedule (semantic then panoptic) to stabilize inner/outer delineation; (iii) modality-specific post-processing—shadow handling for SEM and edge enhancement for TEM; and (iv) training on a curated SEM/TEM dataset with expert annotations.Results: On held-out data, our method reaches 89% recall and 80% precision for object detection (baseline from our previous work: 10% recall, 8% precision). For metrology, we obtain dimensionless R2 scores of 0.84 (inner height), 0.92 (outer height), 0.82 (inner width), and 0.90 (outer width), outperforming OneFormer without fine-tuning (R2≤0.47) and prior methods (R2≤0.57). The pipeline requires only a global bounding box initialization, whereas classical snakes need multi-step initialization.Conclusions: These results indicate reliable automated measurement across SEM and TEM, with explicit handling of shadows and weak boundaries. The framework supports semi-automatic operation with user feedback and can be deployed fully automatically after validation, offering a scalable solution for semiconductor metrology.