diff --git a/roboflow/util/folderparser.py b/roboflow/util/folderparser.py index 5725a8f..63292ca 100644 --- a/roboflow/util/folderparser.py +++ b/roboflow/util/folderparser.py @@ -184,9 +184,9 @@ def _filterIndividualAnnotations(image, annotation, format, imgRefMap, annotatio else: return None elif format == "jsonl": - imgLines = [line for line in parsed if line["image"] == image["name"]] - if imgLines: - _annotation = {"name": "annotation.jsonl", "rawText": json.dumps(imgLines)} + jsonlLines = [json.dumps(line) for line in parsed if line["image"] == image["name"]] + if jsonlLines: + _annotation = {"name": "annotation.jsonl", "rawText": "\n".join(jsonlLines)} return _annotation return None diff --git a/tests/manual/debugme.py b/tests/manual/debugme.py index 3fb4617..762dc22 100644 --- a/tests/manual/debugme.py +++ b/tests/manual/debugme.py @@ -41,6 +41,7 @@ # f"import {thisdir}/data/cultura-pepino-yolov8_voc -w wolfodorpythontests -p yellow-auto -c 100".split() # noqa: E501 // docs # f"import {thisdir}/data/cultura-pepino-yolov5pytorch -w wolfodorpythontests -p yellow-auto -c 100 -n papaiasso".split() # noqa: E501 // docs # f"import {thisdir}/../datasets/mosquitos -w wolfodorpythontests -p yellow-auto -n papaiasso".split() # noqa: E501 // docs - f"deployment list".split() # noqa: E501 // docs + # f"deployment list".split() # noqa: E501 // docs + f"import -w tonyprivate -p meh-plvrv {thisdir}/../datasets/paligemma/".split() # noqa: E501 // docs ) args.func(args) diff --git a/tests/util/test_folderparser.py b/tests/util/test_folderparser.py index 24db3a1..2f58f51 100644 --- a/tests/util/test_folderparser.py +++ b/tests/util/test_folderparser.py @@ -58,20 +58,8 @@ def test_paligemma_format(self): testImagePath = "/dataset/de48275e1ff70fab78bee31e09fc896d_png.rf.01a97b1ad053aa1e6525ac0451cee8b7.jpg" testImage = [i for i in parsed["images"] if i["file"] == testImagePath][0] assert testImage["annotationfile"]["name"] == "annotation.jsonl" - expected = json.dumps( - [ - { - "image": "de48275e1ff70fab78bee31e09fc896d_png.rf.01a97b1ad053aa1e6525ac0451cee8b7.jpg", - "prefix": "Which sector had the highest ROI in 2013?", - "suffix": "Retail", - }, - { - "image": "de48275e1ff70fab78bee31e09fc896d_png.rf.01a97b1ad053aa1e6525ac0451cee8b7.jpg", - "prefix": "Which sector had the highest ROI in 2014?", - "suffix": "Electronics", - }, - ] - ) + expected = """{"image": "de48275e1ff70fab78bee31e09fc896d_png.rf.01a97b1ad053aa1e6525ac0451cee8b7.jpg", "prefix": "Which sector had the highest ROI in 2013?", "suffix": "Retail"} +{"image": "de48275e1ff70fab78bee31e09fc896d_png.rf.01a97b1ad053aa1e6525ac0451cee8b7.jpg", "prefix": "Which sector had the highest ROI in 2014?", "suffix": "Electronics"}""" assert testImage["annotationfile"]["rawText"] == expected