cvat
cvat copied to clipboard
Search by filename
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
I like the idea. Please, let us know if you can help with the implementation.
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>
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!
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()
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).
I also have this problem. The possibility to search for images by filename would be awesome.
Any updates on this UI feature? This is a very nice to have feature.
Very much needed feature.
how can search for image by filename?
coming soon?!!!