cvat icon indicating copy to clipboard operation
cvat copied to clipboard

Search by filename

Open Rikk010 opened this issue 3 years ago • 10 comments

My actions before raising this issue

  • [x] Read/searched the docs
  • [x] Searched past issues

Context

  • When processing the images/annotations I sometimes get some interesting bounding boxes and I would like to look them up in cvat to see if it was annotated wrong or something is wrong with the preprocessing of my own application.
  • Other usecases could be when browsing through images and you want to see the annotations in cvat, to tweak it for example or check the current annotations.

Expected Behaviour

It would be really nice to be able to search by filename there is currently no option to search for filenames.

Current Behaviour

How I currently find the cvat page by filename is a custom little script that iterates over the local storage of the files and returns the index of the file, which is the same as the index in a task. (I first need to get the task aswell)

Possible Solution

Possible sollution could be adding it to the options. Where it links to the task url + ?frame=[num] so you instantly drop into the right frame. Another solution could be an option to search inside a task(but that would mean you have to go through each task/job).

Rikk010 avatar Oct 13 '22 09:10 Rikk010

@Rikk010

I like the idea. Please, let us know if you can help with the implementation.

bsekachev avatar Oct 17 '22 16:10 bsekachev

If you can access the postgres database then this query does the trick to get direct access to a frame via the URL.

Obviously a very hacky approach.

select 
concat('http://<ip-address>:<port-number>/tasks/', et.id, '/jobs/', es.id, '?frame=', frame),
frame, path, et.data_id, et.id task_id, es.id job_id from engine_data ed
inner join engine_image ei
	on ed.id = ei.data_id
inner join engine_task et
	on et.data_id = ei.data_id
inner join engine_segment es
	on es.task_id = et.id 
where path = <file-name>

GeorgePearse avatar Jan 24 '23 20:01 GeorgePearse

If you can access the postgres database then this query does the trick to get direct access to a frame via the URL.

Obviously a very hacky approach.

select 
concat('http://<ip-address>:<port-number>/tasks/', et.id, '/jobs/', es.id, '?frame=', frame),
frame, path, et.data_id, et.id task_id, es.id job_id from engine_data ed
inner join engine_image ei
	on ed.id = ei.data_id
inner join engine_task et
	on et.data_id = ei.data_id
inner join engine_segment es
	on es.task_id = et.id 
where path = <file-name>

I ended up using something like this!

Rikk010 avatar Jan 24 '23 20:01 Rikk010

If you are getting a multiple output

Here I check if engine_image.frame is between engine_segment.start_frame and engine_segment.stop_frame

SELECT concat('http://<ip-address>:<port-number>/tasks/', engine_task.id, '/jobs/', engine_segment.id, '?frame=', engine_image.frame),
       engine_image.frame,
       engine_task.id,
       engine_segment.id
FROM engine_image
INNER JOIN engine_task ON engine_image.data_id = engine_task.data_id
INNER JOIN engine_segment ON engine_task.id = engine_segment.task_id
WHERE PATH=<FILE-name>
  AND engine_segment.start_frame <= engine_image.frame
  AND engine_image.frame <= engine_segment.stop_frame;

Also I have python script, that give you links list by images list

import psycopg2
import os


cvat_url = '111.111.111.111'
cvat_port = '8080'

conn = psycopg2.connect(
    host=cvat_url,
    port="5432",
    database="cvat",
    user="root",
)
cur = conn.cursor()

images_names = ['image123.jpg']

for name in images_names:
    query = f"select concat('http://{cvat_url}:{cvat_port}/tasks/', engine_task.id, '/jobs/', engine_segment.id, '?frame=', engine_image.frame), engine_image.frame, engine_task.id, engine_segment.id from engine_image inner join engine_task on engine_image.data_id = engine_task.data_id inner join engine_segment on engine_task.id =engine_segment.task_id where path='{name}' and engine_segment.start_frame <= engine_image.frame and engine_image.frame <= engine_segment.stop_frame;"
    cur.execute(query)

    for row in cur.fetchall():
        print(row[0])

cur.close()
conn.close()

Tlmonko avatar Feb 21 '23 17:02 Tlmonko

I am also highly interested in a convenient UI-implementation of this option for same reason as Issue creator (checking a possibly wrong label by knowing its filename).

julled avatar Oct 18 '23 23:10 julled

I also have this problem. The possibility to search for images by filename would be awesome.

felixkarevo avatar Jun 26 '24 15:06 felixkarevo

Any updates on this UI feature? This is a very nice to have feature.

santo4ul avatar Aug 19 '24 05:08 santo4ul

Very much needed feature.

KyotoSunshine avatar Nov 25 '24 09:11 KyotoSunshine

how can search for image by filename?

ArreguiInescop avatar Jan 15 '25 15:01 ArreguiInescop

coming soon?!!!

Seazer-x avatar Jun 05 '25 15:06 Seazer-x