• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

vanvalenlab / deepcell-label / 4578689396

pending completion
4578689396

Pull #436

github

GitHub
Merge ddb425c30 into 6a993cb7a
Pull Request #436: Model training overhaul: SNGP model, uncertainty visualization, and custom embedding support

462 of 1163 branches covered (39.72%)

Branch coverage included in aggregate %.

20 of 628 new or added lines in 27 files covered. (3.18%)

76 existing lines in 5 files now uncovered.

3248 of 5431 relevant lines covered (59.8%)

543.49 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/frontend/src/Project/EditControls/CellTypeControls/TrainingUI/PredictionParameters.js
1
import { Button, FormLabel, Grid, MenuItem, TextField } from '@mui/material';
2
import Slider from '@mui/material/Slider/Slider';
3
import { useSelector } from '@xstate/react';
4
import { useTraining } from '../../../ProjectContext';
5

6
function PredictionParameters({ setOpen }) {
NEW
7
  const training = useTraining();
×
NEW
8
  const threshold = useSelector(training, (state) => state.context.uncertaintyThreshold) * 100;
×
NEW
9
  const mode = useSelector(training, (state) => state.context.predictionMode);
×
NEW
10
  const marks = [
×
11
    { value: 0, label: '0%' },
12
    { value: 10 },
13
    { value: 20 },
14
    { value: 30 },
15
    { value: 40 },
16
    { value: 50, label: '50%' },
17
    { value: 60 },
18
    { value: 70 },
19
    { value: 80 },
20
    { value: 90 },
21
    { value: 100, label: '100%' },
22
  ];
23

NEW
24
  const options = ['Over threshold', 'Under threshold', 'Do not make any predictions'];
×
NEW
25
  const modes = ['over', 'under', 'none'];
×
26

NEW
27
  const handleThreshold = (evt) => {
×
NEW
28
    training.send({ type: 'THRESHOLD', uncertaintyThreshold: evt.target.value / 100 });
×
29
  };
30

NEW
31
  const handleMode = (evt) => {
×
NEW
32
    training.send({ type: 'PREDICTION_MODE', predictionMode: evt.target.value });
×
33
  };
34

NEW
35
  const handlePredict = () => {
×
NEW
36
    setOpen(false);
×
NEW
37
    training.send({ type: 'PREDICT' });
×
38
  };
39

NEW
40
  return (
×
41
    <>
42
      <Grid item>
43
        <FormLabel>Uncertainty Threshold</FormLabel>
44
      </Grid>
45
      <Grid item>
46
        <Slider
47
          valueLabelDisplay='auto'
48
          value={threshold}
49
          onChange={handleThreshold}
50
          size='small'
51
          step={null}
52
          marks={marks}
53
          min={0}
54
          max={100}
55
          sx={{
56
            marginLeft: 2,
57
            width: '94%',
58
            '& .MuiSlider-thumb': { height: '1.2em', width: '1.2em' },
59
            '& .MuiSlider-track': { height: '0.2em' },
60
            '& .MuiSlider-rail': { height: '0.2em' },
61
          }}
62
        />
63
      </Grid>
64
      <Grid item>
65
        <FormLabel>Show Prediction Labels</FormLabel>
66
      </Grid>
67
      <Grid item>
68
        <TextField select size='small' value={mode} onChange={handleMode} sx={{ width: '47%' }}>
69
          {options.map((opt, index) => (
NEW
70
            <MenuItem key={index} value={modes[index]}>
×
71
              {opt}
72
            </MenuItem>
73
          ))}
74
        </TextField>
75
        <Button
76
          sx={{
77
            marginLeft: '6%',
78
            width: '47%',
79
          }}
80
          variant='contained'
81
          onClick={handlePredict}
82
        >
83
          Run Inference
84
        </Button>
85
      </Grid>
86
    </>
87
  );
88
}
89

90
export default PredictionParameters;
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc