Skip to content

Commit

Permalink
Error handling and name change
Browse files Browse the repository at this point in the history
  • Loading branch information
paulthatjazz committed Dec 5, 2024
1 parent a961841 commit bb355a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
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

0 comments on commit bb355a3

Please sign in to comment.