Git Product home page Git Product logo

Comments (15)

bowenc0221 avatar bowenc0221 commented on August 20, 2024 1

Instance segmentation is not object detection and thus does not require bbox predictions. But you can always draw a bbox around mask, check issue: #10 (comment)

from mask2former.

FrankFang0813 avatar FrankFang0813 commented on August 20, 2024 1

@bowenc0221 Hi, I have bbox score.Thank you!
I want to ask a question. where should I set confidence-threshold when I demo my dataset?I set the confidence-threshold=0.5 in demo.py, but always detected 100 instances in one Image.It seems an invalid parameter?

from mask2former.

lapp0 avatar lapp0 commented on August 20, 2024 1

You can also do instances = instances[instances.scores > SCORE_THRESHOLD]

from mask2former.

FrankFang0813 avatar FrankFang0813 commented on August 20, 2024

@bowenc0221 Thanks you!!

from mask2former.

yasarniyazoglu avatar yasarniyazoglu commented on August 20, 2024

@FrankFang0813 Hi . I want to do a training with my own efficiency, but I have no idea how to do it. How should your data set be and can you share the training codes with me?

from mask2former.

FrankFang0813 avatar FrankFang0813 commented on August 20, 2024

@yasarniyazoglu Hi,I not sure what you mean.You can't train your custom dataset? Or you have same problem that just have mask AP but don't have bbox AP?

from mask2former.

yasarniyazoglu avatar yasarniyazoglu commented on August 20, 2024

@yasarniyazoglu Hi,I not sure what you mean.You can't train your custom dataset? Or you have same problem that just have mask AP but don't have bbox AP?

I can't train with private data. and I don't know how to do it either. Do you have training codes?

from mask2former.

SEUZTh avatar SEUZTh commented on August 20, 2024

@bowenc0221 Hi, I have bbox score.Thank you! I want to ask a question. where should I set confidence-threshold when I demo my dataset?I set the confidence-threshold=0.5 in demo.py, but always detected 100 instances in one Image.It seems an invalid parameter?

Hello, I met the same problem. Have you sovled it?

from mask2former.

sangtrx avatar sangtrx commented on August 20, 2024

hello which config did you use?

from mask2former.

lapp0 avatar lapp0 commented on August 20, 2024

@bowenc0221 Hi, I have bbox score.Thank you! I want to ask a question. where should I set confidence-threshold when I demo my dataset?I set the confidence-threshold=0.5 in demo.py, but always detected 100 instances in one Image.It seems an invalid parameter?

Its not obvious to me that confidence-threshold actually does something. I cannot find it being used anywhere in the code.

from mask2former.

Jianghanxiao avatar Jianghanxiao commented on August 20, 2024

If you want to set a score to filter the predictions, you can consider doing like below
image

from mask2former.

SEUZTh avatar SEUZTh commented on August 20, 2024

You can also do instances = instances[instances.scores > SCORE_THRESHOLD]

No matter how many instances there are, the size of the model prediction output is always 100.

from mask2former.

AhmadZobairSurosh avatar AhmadZobairSurosh commented on August 20, 2024

@SEUZTh
Hi.
Do you know of any method to make the model prediction output have less than 100 instances?

Cheers

from mask2former.

AhmadZobairSurosh avatar AhmadZobairSurosh commented on August 20, 2024

I have solved this issue. here is my solution:

`

     num_instances = mask_array.shape[0]
        scores = predictions["instances"].scores.cpu().numpy()
        for i in scores:
            if i < args.confidence_threshold: 
                num_instances -= 1
                num_instances = max(num_instances, 0)
        print('num_instances:', num_instances)

`

from mask2former.

SEUZTh avatar SEUZTh commented on August 20, 2024

@SEUZTh Hi. Do you know of any method to make the model prediction output have less than 100 instances?

Cheers

if "instances" in predictions:
    instances = predictions["instances"].to(self.cpu_device) # 类型: <class 'detectron2.structures.instances.Instances'>
    # 取得分大于阈值的实例
    instances_ = Instances(instances.image_size)
    flag = False
    for index in range(len(instances)):
        print(instances[index].scores)
        score = instances[index].scores[0]
        if score > 0.75: # 置信度设置
            if flag == False:
                instances_ = instances[index]
                flag = True
            else:
                instances_ = Instances.cat([instances_, instances[index]])
    vis_output = visualizer.draw_instance_predictions(predictions=instances_)

More information, you can refer to my blog: https://blog.csdn.net/qq_44324181/article/details/126242948

from mask2former.

Related Issues (20)

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.