function index = findsequence(labeldir, category, instance)

threshold = 30;
index = [];
for i = 1:length(labeldir)
    load(labeldir{i});
    frame = 0;
    for j = 1:length(bboxes)
        if length(bboxes{j})
           for s = 1:length(bboxes{j})
               if instance
                  if strcmp(bboxes{j}(s).category, category) & bboxes{j}(s).instance == instance
                     frame = frame + 1;
                  end
               else
                  if strcmp(bboxes{j}(s).category, category)
                     frame = frame + 1;
                  end
               end
           end
        end
    end
    if frame > threshold
       index = [index i];
    end
end

