Skip to content
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

Improved error handling on Segmentation Comp, name change -> AI Model comp #463

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/javascript/projects/modelling/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ export function createDefaultComponents(saveMapLayer: SaveMapLayer, saveModel: S
new NumericConstantComponent(),
new UkcehLandCoverComponent(projectProps),
new LehLandCoverComponent(projectProps),
new SegmentComponent(projectProps),
new IMDComponent(projectProps),
new MlTreeHedgeComponent(projectProps),
//new MlTreeHedgeComponent(projectProps), deprecated
new BiodiversityComponent(projectProps),
new NevoLayerComponent(projectProps),
new ORValComponent(projectProps),
Expand All @@ -81,7 +82,6 @@ export function createDefaultComponents(saveMapLayer: SaveMapLayer, saveModel: S
new ATIComponent(projectProps),
new DesignationsComponent(projectProps),
new SoilComponent(projectProps),
new SegmentComponent(projectProps),

// Outputs
new MapLayerComponent(saveMapLayer),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ async function retrieveSegmentationMasks(prompts: string, det_conf: string, clf_
))

if(segs.status !== 200){
err(segs.statusText)
const segsJson = await segs.json()
const errMsg = segsJson.detail || segsJson.statusText || "Unknown error"
err(`${errMsg}. If issue persists, please raise an issue on the github repo or contact the developer directly ([email protected]).`)
return []
}

Expand Down Expand Up @@ -107,7 +109,7 @@ export class SegmentComponent extends BaseComponent {
projectProps: ProjectProperties

constructor(projectProps: ProjectProperties) {
super("Segmentation Model")
super("AI Model")
this.category = "Inputs"
this.projectProps = projectProps
this.cache = new Map<string, any[]>()
Expand All @@ -120,7 +122,7 @@ export class SegmentComponent extends BaseComponent {
+"and a confidence value. The prompt is the object you want to segment, detector confidence is the confidence "
+"threshold for the detector (it is recommended that this is set low for high recall), classifier confidence is "
+"the confidence threshold for the classifier (it is recommendeded that this is set higher for increased accuracy."
+" please note: setting this to 0 will disable this function), and the number of repeats is the number of times you want to repeat the segmentation process."
+" please note: setting this to 0 will disable this function), and the number of repeats is the number of times you want to repeat the segmentation process. (must be a value higher than 0)."

if (!('det_conf' in node.data)) {
node.data.det_conf = "5"
Expand Down
Loading