-
Notifications
You must be signed in to change notification settings - Fork 36
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
Floating point events + image reconstruction additional arg #8
Open
danielgehrig18
wants to merge
3
commits into
main
Choose a base branch
from
daniel/improvements
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,7 @@ def download_checkpoint(path_to_model): | |
parser.add_argument('--timestamps_file', '-tsf', help='Path to txt file containing image reconstruction timestamps') | ||
parser.add_argument('--upsample_rate', '-u', type=int, default=1, help='Multiplies the number of reconstructions, which effectively lowers the time window of events for E2VID. These intermediate reconstructions will not be saved to disk.') | ||
parser.add_argument('--verbose', '-v', action='store_true', default=False, help='Verbose output') | ||
parser.add_argument('--index_by_order', '-i', action='store_true', default=False, help='Index reconstrutions with 0,1,2,3...') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. default is False anyway for store_true There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed this with the latest commit |
||
|
||
set_inference_options(parser) | ||
|
||
|
@@ -79,14 +80,15 @@ def download_checkpoint(path_to_model): | |
print('Will write images to: {}'.format(os.path.join(args.output_folder, args.dataset_name))) | ||
grid = VoxelGrid(model.num_bins, args.width, args.height, upsample_rate=args.upsample_rate) | ||
pbar = tqdm.tqdm(total=len(data_provider)) | ||
for events in data_provider: | ||
for j, events in enumerate(data_provider): | ||
if events.events.size > 0: | ||
sliced_events = grid.event_slicer(events.events, events.t_reconstruction) | ||
for i in range(len(sliced_events)): | ||
event_grid, _ = grid.events_to_voxel_grid(sliced_events[i]) | ||
event_tensor = torch.from_numpy(event_grid) | ||
if i== len(sliced_events) - 1: | ||
image_reconstructor.update_reconstruction(event_tensor, int(events.t_reconstruction)*1000, save=True) | ||
index = j if args.index_by_order else int(events.t_reconstruction)*1000 | ||
image_reconstructor.update_reconstruction(event_tensor, index, save=True) | ||
pbar.update(1) | ||
else: | ||
image_reconstructor.update_reconstruction(event_tensor) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is dangerous since we don't check that an overflow is not happening.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for other loc that are affected by this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I am conviced, I have changed it back to int64. The memory footprint then grows from 12MB -> 13MB, which should be fine.