# Script Block Examples – Green Classify

This topic contains sample code that stores the found tag and the score for Standard mode.

Copy

Example Codes 1

    1
    2
    3
    4
    5
    6
    7
    8
    var greenView = sample.Markings.Single().Value.Views.SingleOrDefault() as IGreenView;
    if(greenView != null)
    {
        $Pages.Page.greenHDMTool_BestScore.Text = greenView.BestTag.Score.ToString();
        return greenView.BestTag.Name == "normal";
    }
    else return false;

Here is another sample script for Green Classify.

Copy

Example Codes 2

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    // Convert Runtime Block's Sample object to an IGreenMarking object
    var greenMarkings = $Tasks.Task.DeepLearningRuntimeBlock.Sample.Markings["Classify"] as IGreenMarking;

    // Get the Best Tag Result from the Green Markings
    // This line of code presumes that there is only one view.
    var bestTag = greenMarkings.Views.First().BestTag.Name;

    // Return the resultString to the Task level
    return bestTag;