Share via


De indeling van uw COCO-aantekeningsbestand controleren

Tip

Dit artikel is gebaseerd op het Jupyter-notebook check_coco_annotation.ipynb. Open in GitHub.

In deze handleiding ziet u hoe u kunt controleren of de indeling van uw aantekeningsbestand juist is. Installeer eerst het python-voorbeeldpakket vanaf de opdrachtregel:

pip install cognitive-service-vision-model-customization-python-samples

Voer vervolgens de volgende Python-code uit om de indeling van het bestand te controleren. U kunt deze code invoeren in een Python-script of het Jupyter Notebook uitvoeren op een compatibel platform.

from cognitive_service_vision_model_customization_python_samples import check_coco_annotation_file, AnnotationKind, Purpose
import pathlib
import json

coco_file_path = pathlib.Path("{your_coco_file_path}")
annotation_kind = AnnotationKind.MULTICLASS_CLASSIFICATION # or AnnotationKind.OBJECT_DETECTION
purpose = Purpose.TRAINING # or Purpose.EVALUATION

check_coco_annotation_file(json.loads(coco_file_path.read_text()), annotation_kind, purpose)

COCO-bestand gebruiken in een nieuw project

Zodra uw COCO-bestand is geverifieerd, kunt u het importeren in uw modelaanpassingsproject. Zie Een aangepast model maken en trainen en naar de sectie gaan over het selecteren/importeren van een COCO-bestand. U kunt de handleiding van daar tot het einde volgen.

Volgende stappen