-
Notifications
You must be signed in to change notification settings - Fork 588
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
Merge release/v1.2.0
to develop
#5265
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
1594990
support on-disk instance segmentations in SDK
brimoor 68eb682
handle nested roots
brimoor 8331661
handle list fields
brimoor 73da3ae
use buffers for hasFrame (#5264)
benjaminpkane b0388a2
use heuristic for detecting grayscale images
sashankaryal e7f3edd
bump version after release branch creation
findtopher d570937
add 1% min
sashankaryal e48511d
add clarifying comments
sashankaryal d83c00a
fix rgb mask recoloring bug
sashankaryal 64cf79b
Merge pull request #5256 from voxel51/on-disk-instances-updates
brimoor 3956257
Merge branch 'merge/release/v1.2.0' of https://github.com/voxel51/fif…
voxel51-bot 361556a
Merge branch 'release/v1.2.0' of https://github.com/voxel51/fiftyone …
voxel51-bot 3053779
Sort Shuffle Stage in FfityOne App (#5270)
jnewb1 79b8395
fix(ci): AS-359 Update Ubuntu24 Binaries For MongoDB (#5269)
afoley587 8da1243
Sort Shuffle Stage in FfityOne App (#5270) (#5272)
findtopher 76b0663
Merge branch 'merge/release/v1.2.0' of https://github.com/voxel51/fif…
voxel51-bot 4019415
Merge branch 'release/v1.2.0' of https://github.com/voxel51/fiftyone …
voxel51-bot 568da8a
Merge pull request #5266 from voxel51/fix/grayscale-segmentations
sashankaryal 81336a0
Merge branch 'release/v1.2.0' of https://github.com/voxel51/fiftyone …
voxel51-bot 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { describe, expect, it } from "vitest"; | ||
import type { Buffers } from "../state"; | ||
import { hasFrame } from "./utils"; | ||
|
||
describe("looker utilities", () => { | ||
it("determines frame availability given a buffer list", () => { | ||
const BUFFERS: Buffers = [ | ||
[1, 3], | ||
[5, 25], | ||
]; | ||
for (const frameNumber of [1, 10, 25]) { | ||
expect(hasFrame(BUFFERS, frameNumber)).toBe(true); | ||
} | ||
|
||
for (const frameNumber of [0, 4, 26]) { | ||
expect(hasFrame(BUFFERS, frameNumber)).toBe(false); | ||
} | ||
}); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import type { Buffers } from "../state"; | ||
|
||
export const hasFrame = (buffers: Buffers, frameNumber: number) => { | ||
return buffers.some( | ||
([start, end]) => start <= frameNumber && frameNumber <= end | ||
); | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { describe, expect, it } from "vitest"; | ||
import { isGrayscale } from "./canvas-decoder"; | ||
|
||
const createData = ( | ||
pixels: Array<[number, number, number, number]> | ||
): Uint8ClampedArray => { | ||
return new Uint8ClampedArray(pixels.flat()); | ||
}; | ||
|
||
describe("isGrayscale", () => { | ||
it("should return true for a perfectly grayscale image", () => { | ||
const data = createData(Array(100).fill([100, 100, 100, 255])); | ||
expect(isGrayscale(data)).toBe(true); | ||
}); | ||
|
||
it("should return false if alpha is not 255", () => { | ||
const data = createData([ | ||
[100, 100, 100, 255], | ||
[100, 100, 100, 254], | ||
...Array(98).fill([100, 100, 100, 255]), | ||
]); | ||
expect(isGrayscale(data)).toBe(false); | ||
}); | ||
|
||
it("should return false if any pixel is not grayscale", () => { | ||
const data = createData([ | ||
[100, 100, 100, 255], | ||
[100, 101, 100, 255], | ||
...Array(98).fill([100, 100, 100, 255]), | ||
]); | ||
expect(isGrayscale(data)).toBe(false); | ||
}); | ||
|
||
it("should detect a non-grayscale pixel placed deep enough to ensure at least 1% of pixels are checked", () => { | ||
// large image: 100,000 pixels. 1% of 100,000 is 1,000. | ||
// the function will check at least 1,000 pixels. | ||
// place a non-grayscale pixel after 800 pixels. | ||
const pixels = Array(100000).fill([50, 50, 50, 255]); | ||
pixels[800] = [50, 51, 50, 255]; // this is within the first 1% of pixels | ||
const data = createData(pixels); | ||
expect(isGrayscale(data)).toBe(false); | ||
}); | ||
}); |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
🛠️ Refactor suggestion
Add error handling for buffer manipulation.
While the optimization for grayscale images is good, consider adding error handling:
📝 Committable suggestion