Giter Club home page Giter Club logo

Comments (2)

yanhaijun11902 avatar yanhaijun11902 commented on June 27, 2024 1

Got it ,I am deeply indebted to you for your help.

from beyond-iou.

mxbh avatar mxbh commented on June 27, 2024

Hi,
thanks for your interest.

Here's a snippet showing how you can use our method on your binary dataset:

from beyond_iou import Evaluator, build_segmentation_loader, Result

evaluator = Evaluator(
    class_names=['background', 'foreground'],
    ignore_index=255, # optionally modify for your case if there are ignore pixels
    boundary_width=0.01, # choose reasonably for your case
)
loader = build_segmentation_loader(
    pred_dir='path/to/your/predictions', # as 0-1 images, otherwise use pred_label_map to map label ids accordingly
    gt_dir='path/to/your/groundtruth', # as 0-1 images, otherwise use gt_label_map to map label ids accordingly
    gt_label_map=None,
    pred_label_map=None,
    num_workers=0,
    pred_suffix='',
    gt_suffix=''
)
result = evaluator.evaluate(loader)
result.create_report('your/output/directory', exist_ok=True)

This treats background (0) and foreground (1) as separate classes and computes the metrics as the mean over the two classes. If you are interested in the results for the foreground class only, you can access them through result.dataframe.

from beyond-iou.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.