Git Product home page Git Product logo

Comments (2)

haezu avatar haezu commented on June 10, 2024

Hi. Thank you for releasing the code for the paper.
After completing the training, we measured the inference time in the process of testing. But the execution speed is too slow. How do I get the results out of your thesis? What is the problem?

def whole_eval(self, img, output_size, input_size=None, device=None):

        if input_size is not None:
            start = time.perf_counter()
            img, margin = self.process_image(img, input_size)
            end = time.perf_counter()
            print('preprocessing :', end-start, 'seconds')

        else:
            img = self.process_image(img, input_size)

        start = time.perf_counter()

        pred = self.val_func_process(img, device)

        if input_size is not None:
            pred = pred[:, margin[0]:(pred.shape[1] - margin[1]),
                   margin[2]:(pred.shape[2] - margin[3])]
        
        pred = pred.permute(1, 2, 0)
        pred = pred.cpu().numpy()
        if output_size is not None:
            pred = cv2.resize(pred,
                              (output_size[1], output_size[0]),
                              interpolation=cv2.INTER_LINEAR)

        pred = pred.argmax(2)
        end = time.perf_counter()
        print('prediction :', end-start, 'seconds')

        return pred

image

from fasterseg.

chenwydj avatar chenwydj commented on June 10, 2024

Hi @haezu!

Thank you for your interest in our work!

If you set C.is_test = True in the configure file, then the prediction file (which can be uploaded to Cityscapes official leaderboard) will be generated, which makes the test slow. These files (.png) are saved under the prediction directory.

If you just evaluate on the evaluation set (C.is_eval) it is fast.

from fasterseg.

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.