Open Bin1119 opened 1 month ago
Same problem here. I tried to implement the missing functions as below for your reference. (Note that i only tested on the sample data and the function may be wrong)
in io.py
:
def extract_image_by_index(image_list, idx):
# use cv2 to read and return image
return cv2.imread(str(image_list[idx]))
def load_start_and_end_time(dsec_directory):
with h5py.File(str(dsec_directory.events.event_file), 'r') as h5f:
t_offset = h5f['t_offset'][()]
t = h5f['events/t']
return t[0] + t_offset, t[-1] + t_offset
in preprocessing.py
:
def compute_index(detection_index, discrete_timestamps):
mapping = np.zeros_like(discrete_timestamps, dtype="uint64")
for i, t in enumerate(discrete_timestamps):
mapping[i] = np.searchsorted(detection_index, t, side='right') - 1
mapping[i] = max(mapping[i], 0)
mapping[i] = min(mapping[i], len(detection_index) - 1)
return mapping
Again the code might be wrong, be careful when you do the testing.
It's a great job. But I got an error when running scripts/visualize_detections.py. I don't know if the code version needs to be updated.