μΈκ·Έλ¨ΌνΈ μμμ μνν ν μΆλ‘  κ²°κ³Όμμ κ³ λ¦½λ κ°μ²΄λ₯Ό μΆμΆνλ κ²μ΄ λ°λμ§ν  λκ° μμ΅λλ€. μ΄ κ°μ΄λλ Ultralytics μμΈ‘λͺ¨λλ₯Ό μ¬μ©νμ¬ μ΄λ₯Ό μννλ λ°©λ²μ λν μΌλ°μ μΈ λ°©λ²μ μ κ³΅ν©λλ€.

## λ μνΌ μν¬μ€λ£¨

1. νμν λΌμ΄λΈλ¬λ¦¬ μ€μΉμ λν λΉ λ₯Έ μλ΄λUltralytics λΉ λ₯Έ μμ μ€μΉ μΉμμ μ°Έμ‘°νμΈμ.

2. λͺ¨λΈμ λ‘λνκ³  μ€ν `predict()` λ©μλλ₯Ό μ¬μ©ν©λλ€.

``````from ultralytics import YOLO

model = YOLO("yolov8n-seg.pt")

# Run inference
results = model.predict()
``````

μμΈ‘ μΈμκ° μλμ?

``````'ultralytics/assets/bus.jpg'
'ultralytics/assets/zidane.jpg'
``````

μ΄λ μ μν νμ€νΈμ μ μ©ν©λλ€. `predict()` λ©μλλ₯Ό μ¬μ©ν©λλ€.

μΈλΆν λͺ¨λΈμ λν μμΈν λ΄μ©μ λ€μμ μ°Έμ‘°νμΈμ. μΈκ·Έλ¨ΌνΈ μμ νμ΄μ§λ‘ μ΄λν©λλ€. λ€μμ λν΄ μμΈν μμλ³΄λ €λ©΄ `predict()` λ©μλμ λν μμΈν λ΄μ©μ μμΈ‘ λͺ¨λ μΉμμ μ°Έμ‘°νμΈμ.

3. μ΄μ  κ²°κ³Όμ μ€κ³½μ μ λ°λ³΅ν©λλ€. μ΄λ―Έμ§λ₯Ό νμΌλ‘ μ μ₯νλ €λ μν¬νλ‘μ°μ κ²½μ° μμ€ μ΄λ―Έμ§ `base-name` λ° νμ§ `class-label` λ λμ€μ μ¬μ©ν  μ μλλ‘ κ²μλ©λλ€(μ ν μ¬ν­).

``````from pathlib import Path

import numpy as np

# (2) Iterate detection results (helpful for multiple images)
for r in res:
img = np.copy(r.orig_img)
img_name = Path(r.path).stem  # source image base-name

# Iterate each object contour (multiple detections)
for ci, c in enumerate(r):
# (1) Get detection class name
label = c.names[c.boxes.cls.tolist().pop()]
``````
1. νμ§ κ²°κ³Ό μμμ λν΄ μμΈν μμλ³΄λ €λ©΄ μμΈ‘ λͺ¨λμ λ°μ€ μΉμμ μ°Έμ‘°νμΈμ.
2. μμΈν μμλ³΄κΈ° `predict()` κ²°κ³Ό μ°Έμ‘° μμΈ‘ λͺ¨λμ κ²°κ³Ό μμ
For-Loop

λ¨μΌ μ΄λ―Έμ§λ μ²« λ²μ§Έ λ£¨νλ₯Ό ν λ²λ§ λ°λ³΅ν©λλ€. λ¨μΌ κ°μ§λ§ μλ λ¨μΌ μ΄λ―Έμ§λ κ° λ£¨νλ₯Ό ν λ²λ§ λ°λ³΅ν©λλ€.

4. λ¨Όμ  μμ€ μ΄λ―Έμ§μμ μ΄μ§ λ§μ€ν¬λ₯Ό μμ±ν λ€μ λ§μ€ν¬ μμ μ±μμ§ μ€κ³½μ κ·Έλ¦½λλ€. μ΄λ κ² νλ©΄ κ°μ²΄λ₯Ό μ΄λ―Έμ§μ λ€λ₯Έ λΆλΆκ³Ό λΆλ¦¬ν  μ μμ΅λλ€. μμ `bus.jpg` νμ§λ κ² μ€ νλμ λν΄ `person` ν΄λμ€ κ°μ²΄λ₯Ό μ€λ₯Έμͺ½μ νμν©λλ€.

``````import cv2

# (1) Extract contour result
# (2) Changing the type
contour = contour.astype(np.int32)
# (3) Reshaping
contour = contour.reshape(-1, 1, 2)

_ = cv2.drawContours(b_mask, [contour], -1, (255, 255, 255), cv2.FILLED)
``````
1. λ€μμ λν μμΈν μ λ³΄ `c.masks.xy` μ°Έμ‘° μμΈ‘ λͺ¨λμ λ§μ€ν¬ μΉμ.

2. μ¬κΈ°μ κ°μ λ€μκ³Ό κ°μ΄ μΊμ€νλ©λλ€. `np.int32` μμ νΈνμ±μ μν΄ `drawContours()` ν¨μλ₯Ό μ¬μ©ν©λλ€.

3. OpenCV `drawContours()` ν¨μλ μ€κ³½μ μ΄ λ€μκ³Ό κ°μ λͺ¨μμ κ°μ§ κ²μΌλ‘ μμν©λλ€. `[N, 1, 2]` μλ μΉμμ νμ₯νμ¬ μμΈν λ΄μ©μ νμΈνμΈμ.

νμ₯νμ¬ μ μν  λ μ΄λ€ μΌμ΄ λ°μνλμ§ μ΄ν΄ν©λλ€. `contour` λ³μμλλ€.

• `c.masks.xy` :: λ§μ€ν¬ μ€κ³½μ μ μ’νλ₯Ό λ€μκ³Ό κ°μ νμμΌλ‘ μ κ³΅ν©λλ€. `(x, y)`. μμΈν λ΄μ©μ μμΈ‘ λͺ¨λμ λ§μ€ν¬ μΉμ.

• `.pop()` :: As `masks.xy` κ° λ¨μΌ μμλ₯Ό ν¬ν¨νλ λͺ©λ‘μΈ κ²½μ°, μ΄ μμλ `pop()` λ©μλλ₯Ό μ¬μ©ν©λλ€.

• `.astype(np.int32)` :: μ¬μ© `masks.xy` μ λ°μ΄ν° μ νμ΄ `float32`λ₯Ό μ¬μ©ν  μ μμ§λ§, μ΄λ OpenCV `drawContours()` ν¨μλ₯Ό νΈμΆνλ©΄ λ°μ΄ν° μ νμ΄ λ€μκ³Ό κ°μ΄ λ³κ²½λ©λλ€. `int32` νΈνμ±μ νμΈν©λλ€.

• `.reshape(-1, 1, 2)` :: λ°μ΄ν°λ₯Ό νμν λͺ¨μμΌλ‘ λ€μ ν¬λ§·ν©λλ€. `[N, 1, 2]` μ΄λ `N` λ μ€κ³½ μ μ μμ΄λ©°, κ° μ μ λ¨μΌ ν­λͺ©μΌλ‘ νμλ©λλ€. `1`ν­λͺ©μ λ€μκ³Ό κ°μ΄ κ΅¬μ±λ©λλ€. `2` κ°μλλ€. The `-1` λ μ΄ μ°¨μμ κ° μκ° μ μ°νλ€λ κ²μ λνλλλ€.

νμ₯νλ©΄ `drawContours()` κ΅¬μ±.

• μΊ‘μν `contour` λ³μλ₯Ό λκ΄νΈ μμ λ£μ΅λλ€, `[contour]`λ₯Ό μ¬μ©νλ©΄ νμ€νΈ μ€μ μνλ μ€κ³½ λ§μ€ν¬λ₯Ό ν¨κ³Όμ μΌλ‘ μμ±νλ κ²μΌλ‘ λνλ¬μ΅λλ€.

• κ° `-1` μ μ§μ λ `drawContours()` λ§€κ°λ³μλ μ΄λ―Έμ§μ μ‘΄μ¬νλ λͺ¨λ  μ€κ³½μ μ κ·Έλ¦¬λλ‘ ν¨μμ μ§μν©λλ€.

• κ·Έλ¦¬κ³  `tuple` `(255, 255, 255)` λ μ΄ μ΄μ§ λ§μ€ν¬μμ μ€κ³½μ μ κ·Έλ¦΄ λ μνλ μμμΈ ν°μμ λνλλλ€.

• μΆκ° `cv2.FILLED` λ μ€κ³½ κ²½κ³λ‘ λλ¬μΈμΈ λͺ¨λ  ν½μμ μμ λμΌνκ² μ§μ νλ©°, μ΄ κ²½μ° λλ¬μΈμΈ λͺ¨λ  ν½μμ ν°μμ΄ λ©λλ€.

• μ°Έμ‘° OpenCV λ¬Έμ `drawContours()` μμ μμΈν λ΄μ©μ νμΈνμΈμ.

5. λ€μμΌλ‘ μ΄ μμ μμ μ΄λ―Έμ§λ₯Ό μ§ννλ λ°©λ²μ λν λ κ°μ§ μ΅μκ³Ό κ° μ΅μμ λν νμ μ΅μμ΄ μμ΅λλ€.

μ

``````# Create 3-channel mask

# Isolate object with binary mask
``````
μ΄λ»κ² μλνλμ?
• λ¨Όμ  λ°μ΄λλ¦¬ λ§μ€ν¬κ° λ¨Όμ  λ¨μΌ μ±λ μ΄λ―Έμ§μμ 3μ±λ μ΄λ―Έμ§λ‘ λ³νλ©λλ€. μ΄ λ³νμ λ§μ€ν¬μ μλ³Έ μ΄λ―Έμ§κ° κ²°ν©λλ νμ λ¨κ³μ νμν©λλ€. λΈλ λ© μμκ³Ό νΈνλλ €λ©΄ λ μ΄λ―Έμ§μ μ±λ μκ° κ°μμΌ ν©λλ€.

• μλ³Έ μ΄λ―Έμ§μ 3μ±λ λ°μ΄λλ¦¬ λ§μ€ν¬λ OpenCV ν¨μλ₯Ό μ¬μ©νμ¬ λ³ν©λ©λλ€. `bitwise_and()`. μ΄ μμμ λ€μμ μ μ§ν©λλ€. λ§ 0λ³΄λ€ ν° ν½μ κ° `(> 0)` λ₯Ό μ κ±°ν©λλ€. λ§μ€ν¬ ν½μμ΄ 0λ³΄λ€ ν¬λ―λ‘ `(> 0)` λ§ μ€κ³½μ  μμ­ λ΄μμ μλ³Έ μ΄λ―Έμ§μμ λ¨μ ν½μμ μ€κ³½μ κ³Ό κ²ΉμΉλ ν½μμλλ€.

### κ²μμ ν½μλ‘ κ²©λ¦¬: νμ μ΅μ

μ μ²΄ ν¬κΈ° μ΄λ―Έμ§

μ μ²΄ ν¬κΈ° μ΄λ―Έμ§λ₯Ό μ μ§νλ κ²½μ° μΆκ° λ¨κ³κ° νμνμ§ μμ΅λλ€.

μλ¦° κ°μ²΄ μ΄λ―Έμ§

``````# (1) Bounding box coordinates
x1, y1, x2, y2 = c.boxes.xyxy.cpu().numpy().squeeze().astype(np.int32)
# Crop image to object region
iso_crop = isolated[y1:y2, x1:x2]
``````

1. λ°μ΄λ© λ°μ€ κ²°κ³Όμ λν μμΈν λ΄μ©μ μμΈ‘ λͺ¨λμ λ°μ€ μΉμμ μ°Έμ‘°νμ­μμ€.
μ΄ μ½λλ μ΄λ€ κΈ°λ₯μ νλμ?
• κ·Έλ¦¬κ³  `c.boxes.xyxy.cpu().numpy()` νΈμΆμ λ°μ΄λ© λ°μ€λ₯Ό NumPy λ°°μ΄λ‘ κ²μν©λλ€. `xyxy` νμμΌλ‘, μ¬κΈ°μ `xmin`, `ymin`, `xmax`λ° `ymax` λ λ°μ΄λ© λ°μ€ μ§μ¬κ°νμ μ’νλ₯Ό λνλλλ€. μ°Έμ‘° μμΈ‘ λͺ¨λμ λ°μ€ μΉμ μμ μμΈν λ΄μ©μ νμΈνμΈμ.

• κ·Έλ¦¬κ³  `squeeze()` μ°μ°μ NumPy λ°°μ΄μμ λΆνμν μΉμλ₯Ό μ κ±°νμ¬ μμλλ λͺ¨μμ κ°λλ‘ ν©λλ€.

• λ€μμ μ¬μ©νμ¬ μ’ν κ° λ³ννκΈ° `.astype(np.int32)` μμ μμ μ’ν λ°μ΄ν° μ νμ λ³κ²½ν©λλ€. `float32` μ `int32`λ₯Ό μ¬μ©νμ¬ μΈλ±μ€ μ¬λΌμ΄μ€λ₯Ό μ¬μ©ν μ΄λ―Έμ§ μλ₯΄κΈ°μ νΈνλ©λλ€.

• λ§μ§λ§μΌλ‘ μΈλ±μ€ μ¬λΌμ΄μ±μ μ¬μ©νμ¬ μ΄λ―Έμ§μμ λ°μ΄λ© λ°μ€ μμ­μ μλΌλλλ€. κ²½κ³λ `[ymin:ymax, xmin:xmax]` κ°μ§ κ²½κ³ μμμ μ’νμλλ€.

``````# Isolate object with transparent background (when saved as PNG)
``````
μ΄λ»κ² μλνλμ?
• NumPy μ¬μ© `dstack()` ν¨μ(κΉμ΄ μΆμ λ°λΌ λ°°μ΄ μ€ννΉ)λ₯Ό μμ±λ μ΄μ§ λ§μ€ν¬μ ν¨κ» μ¬μ©νλ©΄ 4κ°μ μ±λμ΄ μλ μ΄λ―Έμ§κ° μμ±λ©λλ€. μ΄λ κ² νλ©΄ μ€λΈμ νΈ μ€κ³½μ  μΈλΆμ λͺ¨λ  ν½μμ ν¬λͺνκ² λ§λ€ μ μμ΅λλ€. `PNG` νμΌμ λ§λ­λλ€.

### ν¬λͺ ν½μλ‘ κ²©λ¦¬: νμ μ΅μ

μ μ²΄ ν¬κΈ° μ΄λ―Έμ§

μ μ²΄ ν¬κΈ° μ΄λ―Έμ§λ₯Ό μ μ§νλ κ²½μ° μΆκ° λ¨κ³κ° νμνμ§ μμ΅λλ€.

μλ¦° κ°μ²΄ μ΄λ―Έμ§

``````# (1) Bounding box coordinates
x1, y1, x2, y2 = c.boxes.xyxy.cpu().numpy().squeeze().astype(np.int32)
# Crop image to object region
iso_crop = isolated[y1:y2, x1:x2]
``````

1. λ°μ΄λ© λ°μ€ κ²°κ³Όμ λν μμΈν λ΄μ©μ μμΈ‘ λͺ¨λμ λ°μ€ μΉμμ μ°Έμ‘°νμ­μμ€.
μ΄ μ½λλ μ΄λ€ κΈ°λ₯μ νλμ?
• μ¬μ© μ `c.boxes.xyxy.cpu().numpy()`λ₯Ό μ¬μ©νμ¬ κ²½κ³ μμλ₯Ό NumPy λ°°μ΄λ‘ λ°νν©λλ€. `xyxy` μμ μ’ν νμμΌλ‘, ν¬μΈνΈμ ν΄λΉνλ `xmin, ymin, xmax, ymax` λ°μ΄λ© λ°μ€(μ§μ¬κ°ν)μ κ²½μ°, λ€μμ μ°Έμ‘°νμ­μμ€. μμΈ‘ λͺ¨λμ λ°μ€ μΉμ μμ μμΈν λ΄μ©μ νμΈνμΈμ.

• μΆκ° `squeeze()` λ λΆνμν μ°¨μμ΄ NumPy λ°°μ΄μμ μ κ±°λλλ‘ ν©λλ€.

• λ€μμ μ¬μ©νμ¬ μ’ν κ° λ³ννκΈ° `.astype(np.int32)` μμ μμ μ’ν λ°μ΄ν° μ νμ λ³κ²½ν©λλ€. `float32` μ `int32` μΈλ±μ€ μ¬λΌμ΄μ€λ₯Ό μ¬μ©νμ¬ μ΄λ―Έμ§λ₯Ό μλ₯Ό λ νΈνλ©λλ€.

• λ§μ§λ§μΌλ‘ μΈλ±μ€ μ¬λΌμ΄μ±μ μ¬μ©νμ¬ κ²½κ³ μμμ λν μ΄λ―Έμ§ μμ­μ μλ₯΄κ³ , μ¬κΈ°μ κ²½κ³λ `[ymin:ymax, xmin:xmax]` κ°μ§ κ²½κ³ μμμ μ’νμλλ€.

λ°°κ²½μ ν¬ν¨νμ¬ μλ¦° κ°μ²΄λ₯Ό μνλ©΄ μ΄λ»κ² νλμ?

μ΄ κΈ°λ₯μ Ultralytics λΌμ΄λΈλ¬λ¦¬μ λ΄μ₯λ κΈ°λ₯μλλ€. λΌμ΄λΈλ¬λ¦¬μμ `save_crop` μ λν μΈμ μμΈ‘ λͺ¨λ μΆλ‘  μΈμ λ₯Ό μ°Έμ‘°νμΈμ.

6. λ€μμ μνν  μμμ μ μ μΌλ‘ κ°λ°μμκ² λ¬λ € μμ΅λλ€. κ°λ₯ν λ€μ λ¨κ³(λμ€μ μ¬μ©ν  μ μλλ‘ μ΄λ―Έμ§λ₯Ό νμΌμ μ μ₯)μ κΈ°λ³Έ μκ° λμ μμ΅λλ€.

• μ°Έκ³ : μ΄ λ¨κ³λ μ ν μ¬ν­μ΄λ©° νΉμ  μ¬μ© μ¬λ‘μ νμνμ§ μμ κ²½μ° κ±΄λλΈ μ μμ΅λλ€.
μ΅μ’ λ¨κ³ μμ
``````# Save isolated object to file
_ = cv2.imwrite(f"{img_name}_{label}-{ci}.png", iso_crop)
``````
• μ΄ μμ μμλ `img_name` μ μμ€ μ΄λ―Έμ§ νμΌμ κΈ°λ³Έ μ΄λ¦μλλ€, `label` μ κ°μ§λ ν΄λμ€ μ΄λ¦μ΄κ³  `ci` λ κ°μ²΄ κ°μ§μ μΈλ±μ€μλλ€(λμΌν ν΄λμ€ μ΄λ¦μ κ°μ§ μΈμ€ν΄μ€κ° μ¬λ¬ κ° μλ κ²½μ°).

## μ μ²΄ μμ  μ½λ

μ¬κΈ°μμλ μ΄μ  μΉμμ λͺ¨λ  λ¨κ³λ₯Ό νλμ μ½λ λΈλ‘μΌλ‘ κ²°ν©ν©λλ€. λ°λ³΅μ μΌλ‘ μ¬μ©νλ €λ©΄ μΌλΆ λλ λͺ¨λ  λͺλ Ήμ μννλ ν¨μλ₯Ό μ μνλ κ²μ΄ κ°μ₯ μ’μ΅λλ€. `for`-λ£¨νλ₯Ό μ¬μ©ν  μλ μμ§λ§, μ΄λ λμμ νλ¨μ λ§‘κΈ°κ² μ΅λλ€.

``````from pathlib import Path

import cv2
import numpy as np

from ultralytics import YOLO

m = YOLO("yolov8n-seg.pt")  # (4)!
res = m.predict()  # (3)!

# Iterate detection results (5)
for r in res:
img = np.copy(r.orig_img)
img_name = Path(r.path).stem

# Iterate each object contour (6)
for ci, c in enumerate(r):
label = c.names[c.boxes.cls.tolist().pop()]

_ = cv2.drawContours(b_mask, [contour], -1, (255, 255, 255), cv2.FILLED)

# Choose one:

# OPTION-1: Isolate object with black background

# OPTION-2: Isolate object with transparent background (when saved as PNG)

# OPTIONAL: detection crop (from either OPT1 or OPT2)
x1, y1, x2, y2 = c.boxes.xyxy.cpu().numpy().squeeze().astype(np.int32)
iso_crop = isolated[y1:y2, x1:x2]

# TODO your actions go here (2)
``````
1. μ€ μ±μ°κΈ° `contour` λ μμμ μ¬λ¬ μ€λ‘ λλμ΄ μλ κ²μ μ¬κΈ°μλ ν μ€λ‘ ν©μ³€μ΅λλ€.
2. μ¬κΈ°μ λ¬΄μμ λ£μμ§λ μ¬λ¬λΆμκ² λ¬λ € μμ΅λλ€!
3. μμΈν λ΄μ©μ μμΈ‘ λͺ¨λλ₯Ό μ°Έμ‘°νμΈμ.
4. μμΈν λ΄μ©μ μΈκ·Έλ¨ΌνΈ μμμ μ°Έμ‘°νμΈμ.
5. κ²°κ³Ό μμμ λν΄ μμΈν μμλ³΄κΈ°
6. μΈλΆν λ§μ€ν¬ κ²°κ³Όμ λν΄ μμΈν μμλ³΄κΈ°

## μμ£Ό λ¬»λ μ§λ¬Έ

1. λͺ¨λΈμ λ‘λνκ³  μΆλ‘ μ μ€νν©λλ€:

``````from ultralytics import YOLO

model = YOLO("yolov8n-seg.pt")
results = model.predict(source="path/to/your/image.jpg")
``````
2. λ°μ΄λλ¦¬ λ§μ€ν¬λ₯Ό μμ±νκ³  μ€κ³½μ μ κ·Έλ¦½λλ€:

``````import cv2
import numpy as np

img = np.copy(results[0].orig_img)
cv2.drawContours(b_mask, [contour], -1, (255, 255, 255), cv2.FILLED)
``````

``````mask3ch = cv2.cvtColor(b_mask, cv2.COLOR_GRAY2BGR)
``````

μμΈν λ΄μ©μ μμΈ‘ λͺ¨λ λ° μΈκ·Έλ¨ΌνΈ μμμ λν κ°μ΄λλ₯Ό μ°Έμ‘°νμΈμ.

### μΈλΆν ν λΆλ¦¬λ κ°μ²΄λ₯Ό μ μ₯νλ λ° μ¬μ©ν  μ μλ μ΅μμλ μ΄λ€ κ²μ΄ μλμ?

Ultralytics YOLOv8 λ κ²©λ¦¬λ κ°μ²΄λ₯Ό μ μ₯νλ λ κ°μ§ μ£Όμ μ΅μμ μ κ³΅ν©λλ€:

1. κ²μμ λ°°κ²½:

``````mask3ch = cv2.cvtColor(b_mask, cv2.COLOR_GRAY2BGR)
``````

``````isolated = np.dstack([img, b_mask])
``````

μμΈν λ΄μ©μ μμΈ‘ λͺ¨λ μΉμμ μ°Έμ‘°νμΈμ.

### Ultralytics YOLOv8 μ μ¬μ©νμ¬ κ³ λ¦½λ κ°μ²΄λ₯Ό κ²½κ³ μμλ‘ μλ₯΄λ €λ©΄ μ΄λ»κ² ν΄μΌ νλμ?

κ³ λ¦½λ κ°μ²΄λ₯Ό κ²½κ³ μμλ‘ μλ¦λλ€:

``````x1, y1, x2, y2 = results[0].boxes.xyxy[0].cpu().numpy().astype(np.int32)
``````
2. λΆλ¦¬λ μ΄λ―Έμ§λ₯Ό μλ¦λλ€:

``````iso_crop = isolated[y1:y2, x1:x2]
``````

### μΈλΆν μμμμ κ°μ²΄ κ²©λ¦¬λ₯Ό μν΄ Ultralytics YOLOv8 μ μ¬μ©ν΄μΌ νλ μ΄μ λ λ¬΄μμΈκ°μ?

• κ³ μ μ€μκ° κ°μ²΄ κ°μ§ λ° μΈλΆν.
• μ νν μ€λΈμ νΈ κ²©λ¦¬λ₯Ό μν μ νν λ°μ΄λ© λ°μ€ λ° λ§μ€ν¬ μμ±.
• ν¨μ¨μ μΈ κ°λ°μ μν ν¬κ΄μ μΈ λ¬Έμμ μ¬μ©νκΈ° μ¬μ΄ APIλ₯Ό μ κ³΅ν©λλ€.

μΈκ·Έλ¨ΌνΈ μμ λ¬Έμμμ YOLO μ¬μ©μ μ΄μ μ μ΄ν΄λ³΄μΈμ.

### Ultralytics YOLOv8 μ μ¬μ©νμ¬ λ°°κ²½μ ν¬ν¨νμ¬ κ³ λ¦½λ κ°μ²΄λ₯Ό μ μ₯ν  μ μλμ?

μ, μ΄κ²μ Ultralytics YOLOv8 μ λ΄μ₯λ κΈ°λ₯μλλ€. μ΄ κΈ°λ₯μ μ¬μ©νλ €λ©΄ `save_crop` μΈμμ `predict()` λ©μλλ₯Ό μ¬μ©ν©λλ€. μλ₯Ό λ€μ΄

``````results = model.predict(source="path/to/your/image.jpg", save_crop=True)
``````

μμΈν μμλ³΄κΈ° `save_crop` μΈμμ μμΈ‘ λͺ¨λ μΆλ‘  μΈμ μΉμμΌλ‘ μ΄λν©λλ€.

9κ°μ μ  μμ±λ¨ βοΈ μλ°μ΄νΈλ¨ 8 μΌ μ 