Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility to segment multiple obects at once? #5

Open
ashwinjosephk opened this issue Jan 6, 2025 · 0 comments
Open

Possibility to segment multiple obects at once? #5

ashwinjosephk opened this issue Jan 6, 2025 · 0 comments

Comments

@ashwinjosephk
Copy link

Hey I have been trying to do segmentation task using the command:

task_prompt = '<REGION_TO_SEGMENTATION>'
text_input = "segment all visible objects in the image"
result = run_example(task_prompt, text_input=text_input)
print(results_sky)
output_image = copy.deepcopy(image)
output_image = draw_polygons(output_image, result['<REGION_TO_SEGMENTATION>'], fill_mask=True)

the output i get is for just a single polygon though there are clearly multiple images in the object, in hte prompt if i specify the individual object prompt it works perfectly like car, horse, but when I give the prompt for all objects it wouldnt, how do i fix this?

Sample output:
{'<REGION_TO_SEGMENTATION>': {'polygons': [[[77.9520034790039, 106.84650421142578, 81.79199981689453, 106.84650421142578, 84.86399841308594, 107.72050476074219, 87.93599700927734, 108.5945053100586, 91.00800323486328, 110.77950286865234, 92.54399871826172, 110.77950286865234, 95.61599731445312, 111.65350341796875, 98.68800354003906, 113.8385009765625, 100.2239990234375, 113.8385009765625, 103.2959976196289, 115.58650207519531, 104.83200073242188, 115.58650207519531, 107.90399932861328, 117.77149963378906, 109.44000244140625, 117.77149963378906, 111.74400329589844, 118.64550018310547, 114.81600189208984, 120.83050537109375, 119.42400360107422, 125.63750457763672, 120.19200134277344, 125.63750457763672, 124.03199768066406, 128.69650268554688, 128.63999938964844, 132.62950134277344, 134.01600646972656, 137.87350463867188, 134.01600646972656, 139.6215057373047, 135.552001953125, 142.6804962158203, 135.552001953125, 144.86550903320312, 134.01600646972656, 145.739501953125, 133.2480010986328, 148.7985076904297, 133.2480010986328, 165.8415069580078, 134.01600646972656, 166.7154998779297, 135.552001953125, 169.77450561523438, 136.32000732421875, 174.5814971923828, 136.32000732421875, 179.82550048828125, 137.08799743652344, 180.6995086669922, 138.62400817871094, 183.7584991455078, 138.62400817871094, 190.75050354003906, 137.08799743652344, 192.9355010986328, 134.01600646972656, 193.80950927734375, 131.71200561523438, 193.80950927734375, 130.94400024414062, 192.9355010986328, 127.10400390625, 191.62449645996094, 124.03199768066406, 191.62449645996094, 123.26399993896484, 192.9355010986328, 117.12000274658203, 191.62449645996094, 114.81600189208984, 191.62449645996094, 114.04800415039062, 192.9355010986328, 107.90399932861328, 191.62449645996094, 104.83200073242188, 191.62449645996094, 104.06400299072266, 192.9355010986328, 96.38400268554688, 191.62449645996094, 94.08000183105469, 191.62449645996094, 87.93599700927734, 192.9355010986328, 85.63200378417969, 193.80950927734375, 84.09600067138672, 195.55751037597656, 82.55999755859375, 197.7425079345703, 82.55999755859375, 199.92750549316406, 81.79199981689453, 201.67550659179688, 80.2560043334961, 203.86050415039062, 77.9520034790039, 204.7344970703125, 75.64800262451172, 204.7344970703125, 74.11199951171875, 206.9195098876953, 71.80799865722656, 207.7935028076172, 68.73600006103516, 208.66749572753906, 63.36000061035156, 208.66749572753906, 60.288002014160156, 208.66749572753906, 57.98400115966797, 208.66749572753906, 57.215999603271484, 209.54150390625, 54.14400100708008, 210.85250854492188, 48.0, 211.72650146484375, 32.63999938964844, 212.6005096435547, 8.831999778747559, 212.6005096435547, 6.5279998779296875, 210.85250854492188, 5.760000228881836, 207.7935028076172, 5.760000228881836, 164.093505859375, 6.5279998779296875, 161.90850830078125, 48.0, 161.90850830078125, 50.30400085449219, 161.0345001220703, 51.84000015258789, 158.84950256347656, 51.84000015258789, 145.739501953125, 51.071998596191406, 144.86550903320312, 50.30400085449219, 132.62950134277344, 50.30400085449219, 127.82250213623047, 50.30400085449219, 124.76350402832031, 50.30400085449219, 121.70449829101562, 51.84000015258789, 119.51950073242188, 54.9119987487793, 117.77149963378906, 57.98400115966797, 116.89749908447266, 60.288002014160156, 114.7125015258789, 61.82400131225586, 113.8385009765625, 64.12799835205078, 113.8385009765625, 65.66400146484375, 112.52750396728516, 67.96800231933594, 110.77950286865234, 71.80799865722656, 108.5945053100586, 74.11199951171875, 108.5945053100586, 76.41600036621094, 106.84650421142578]]], 'labels': ['']}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant