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

High priority Queries involving Object detection to be supported #144

Closed
gaurav274 opened this issue Feb 22, 2021 · 0 comments
Closed

High priority Queries involving Object detection to be supported #144

gaurav274 opened this issue Feb 22, 2021 · 0 comments
Assignees

Comments

@gaurav274
Copy link
Member

gaurav274 commented Feb 22, 2021

UNNEST: #143
JOIN: TBD
ARRAY_FUNCTIONs: TBD (https://www.postgresql.org/docs/8.4/functions-array.html)

 
-- GET frames with pedestrians
SELECT id, frame
FROM DETRAC
WHERE ['pedestrain'] <@ ObjDet(frame).labels;

-- GET frames with a pedestrian and a car
SELECT id, frame
FROM DETRAC
WHERE ['pedestrain', 'car'] <@ ObjDet(frame).labels;

-- GET frames with more than 5 cars
SELECT id, frame
FROM DETRAC
WHERE array_count(ObjDet(frame).labels, 'car') > 5;

-- GET frames with 2 pedestrians and 5 car
SELECT id, frame
FROM DETRAC
WHERE array_count(ObjDet(frame).labels, 'car') = 5 
       and array_count(ObjDet(frame).labels, 'pedestrian') = 2;

-- GET frames with red cars
SELECT id, frame
FROM DETRAC, UNNEST(ObjDet(frame)) as T(label, bbox) 
WHERE label = 'car' and COLOR(frame, bbox) = 'red';

-- GET frames with cars masking 50% frame area
SELECT id, frame
FROM DETRAC, UNNEST(ObjDet(frame)) as T(label, bbox) 
WHERE label = 'car' and AREA(frame, bbox) > 0.5;

-- GET bboxes of all red cars
SELECT id, frame, bboxes
FROM DETRAC, UNNEST(ObjDet(frame)) as T(label, bbox)  
WHERE label = 'car' and AREA(frame, bbox) = 'red' 
GROUPBY id;

-- GET first 100 frames with red car
SELECT id, frame
FROM DETRAC, UNNEST(ObjDet(frame)) as T(label, bbox) 
WHERE label = 'car' and COLOR(frame, bbox) = 'red'
LIMIT 100;










Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants