Coder Social home page Coder Social logo

orgtrack's Introduction

OrgTrack

直接接入模型预测接口即可,或直接使用延时标签图像进行单个类器官图像追踪

  1. 修改 main.py 中网络:

      if  model_name=="MACP":  
             """  
             网络预测接口  
             """  
             model = MACPNet.MACP.MVCnet()  
             model = model.to(device)  
             model.load_state_dict(torch.load(r'MACPNet\MACP.pth', map_location='cpu'))  
    
  2. 或者使用网络分割好的mask进行stack后替换下面代码中的“imge”:

      if show_label==True:
          def img2bin(imge):
              newimg = []
              for i ,tempt in enumerate(imge) :
                  # 示例输入张量
                  input_tensor = tempt
                  np_input=np.array(input_tensor)
                  #边缘检测,hysteresisMaximum=0.05,hysteresisMinimum=0.005用于分离的高低阈值参数
                  output_tensor_edge=(outtool.DetectEdges(np.expand_dims(np_input,axis=0),gaussianSigma=2.0,hysteresisMaximum=0.05,hysteresisMinimum=0.005,foregroundThreshold=0.5)).astype('int8')
                  #分离,阈值foregroundThreshold=0.5
                  output_tensor_seperate=outtool.SeparateContours(edges=output_tensor_edge,images=np.expand_dims(np_input,axis=0),foregroundThreshold=0.5,gaussianSigma=2)
                  #填孔,过滤尺寸较小的类器官minimumArea=50
                  output_tensor=outtool.Cleanup(output_tensor_seperate,minimumArea=50,fillHoles=True,removeBorders=False)
                  # 遍历每张图像
                  newimg.append(output_tensor[0])
              newimg = np.stack(newimg, axis=0)
              return newimg
          tailuo = np.expand_dims(img2bin(imge),axis=1)
          return tailuo,image_name
    

orgtrack's People

Contributors

ucas-dx avatar

Watchers

 avatar

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.