Skip to content

Commit

Permalink
Adding indicator column
Browse files Browse the repository at this point in the history
  • Loading branch information
carlyrichmond committed Apr 22, 2024
1 parent c40e5eb commit b256bd4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,21 @@ function ClassifierTableRow(props) {
return classifier;
}

function getMatchIndicator() {
if (props.result.expected_category === props.result.user_category) {
return '✅';
}

return '❌';
}

return (
<>
<tr className={`${ props.rowNumber % 2 === 0 ? 'alternative-row' : 'row'}`}>
<th>
<img className="image" alt="Random image" src={props.result.image_url} />
</th>
<th>{ getMatchIndicator() }</th>
<th className="classification">{ props.result.expected_category }</th>
<th className="classification">{ props.result.user_category }</th>
<th className="classification">{ formatClassificationCollections(props.result.models.mobilenet_classifier, 'className') }</th>
Expand Down
1 change: 1 addition & 0 deletions cake-game/src/routes/end/End.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ function End() {
<thead className="table-header">
<tr className="header-row">
<th>Image</th>
<th>Match</th>
<th>Expected</th>
<th>You</th>
<th>MobileNet</th>
Expand Down

0 comments on commit b256bd4

Please sign in to comment.