diff --git a/test.py b/test.py index 55d9398e9d2fb5e51de72f7f2b307c917e352e55..4b22304fab2ef79aa90d9111469e89b053b44d25 100644 --- a/test.py +++ b/test.py @@ -30,17 +30,28 @@ class RandomPredictor(AirbornePredictor): NOTE: In case you want to load your model, please do so in `predict_setup` function. """ def inference(self, flight_id): + # In this random example, we are making use of dataset exploration i.e. objects are generally located somewhere near + # center range, and similarly for typical range of frames they are visible, etc... + class_name = random.choice(["Airplane1", "Helicopter1"]) + track_id = random.randint(0, 3) + bbox = [random.uniform(1300, 1500), random.uniform(1000, 1200), random.uniform(50, 100), random.uniform(50, 100)] + + initial_empty_frames = random.randint(500, 900) + frame_with_airborne_object = random.randint(100, 200) + for frame_image in self.get_all_frame_images(flight_id): - frame_image_path = self.get_frame_image_location(flight_id, frame_image) - img = Image.open(frame_image_path) - # Do something... - - for i in range(random.randint(-4, 7)): - bbox = [random.uniform(1300, 1500), random.uniform(1000, 1200), random.uniform(50, 100), - random.uniform(50, 100)] + # frame_image_path = self.get_frame_image_location(flight_id, frame_image) + # img = Image.open(frame_image_path) + # Do something... (example of loading images for evaluation) + + initial_empty_frames -= 1 + if initial_empty_frames > 0: + continue + + frame_with_airborne_object -= 1 + if frame_with_airborne_object > 0: confidence = random.uniform(0.5, 1) - class_name = random.choice(["Airplane1", "Helicopter1"]) - self.register_object_and_location(class_name, random.randint(0, 3), bbox, confidence, frame_image) + self.register_object_and_location(class_name, track_id, bbox, confidence, frame_image) if __name__ == "__main__":