-
Notifications
You must be signed in to change notification settings - Fork 838
fix: test asset distribution to include all tags on test/train split #823
fix: test asset distribution to include all tags on test/train split #823
Conversation
@hermanho please re-target your PR to the |
The test asset may not included all tags when export with test/train split option in current venison (2.1.0).
52f528a
to
c609dc6
Compare
Codecov Report
@@ Coverage Diff @@
## master #823 +/- ##
==========================================
- Coverage 87.9% 87.76% -0.14%
==========================================
Files 129 129
Lines 4845 4880 +35
Branches 922 929 +7
==========================================
+ Hits 4259 4283 +24
- Misses 584 595 +11
Partials 2 2
Continue to review full report at Codecov.
|
@tbarlow12 changed |
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.
Nice job on this - especially the shared logic used between Pascal VOC & CNTK. @JacopoMangiavacchi Can you please take a pass on these changes.
src/providers/export/cntk.ts
Outdated
@@ -3,6 +3,7 @@ import { ExportProvider, IExportResults } from "./exportProvider"; | |||
import { IAssetMetadata, IExportProviderOptions, IProject } from "../../models/applicationState"; | |||
import HtmlFileReader from "../../common/htmlFileReader"; | |||
import Guard from "../../common/guard"; | |||
import {splitTestAsset} from "./testAssetsSplitHelper"; |
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.
Nit: Spacing around {
in import statements.
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.
Fixed in bfce1ec
export function splitTestAsset(allAssets: IAssetMetadata[], tags: ITag[], testSplitRatio: number): string[] { | ||
const testAssets: string[] = []; | ||
|
||
if (testSplitRatio > 0 && testSplitRatio <= 1) { |
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.
Consider inverting if statement to reduce code nesting.
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.
Fixed in 74a5a81
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.
LGTM. Yes kudos for the splitTestAsset helper
The test asset may not included all tags when export with test/train split option and uneven distribution of tags in current venison (2.1.0). Here is an example:
Image 1-8 are tagged with Tag-1.
Image 9-10 are tagged with Tag-2.
Export provider: PascalVOC
Asset State: Only tagged Assets
Test / Train Split is 80%.
Output
tag-1_val.txt
tag-2_val.txt
In current venison, there is no images of tag "Tag-1" in the text file "tag-1_val.txt" because the split method is based on the whole image set so only image 9 & 10 are put in test asset. The split method is changed to extract the test assets by each tag and combine them at the end. Image 7,8,10 will put in test asset after the change applied.
Output
tag-1_val.txt
tag-2_val.txt