Code Monkey home page Code Monkey logo

spacecode-live / flask_video__client_server_resize-pic Goto Github PK

View Code? Open in Web Editor NEW
1.0 0.0 0.0 22 KB

AnyVision Dev. Interview Task You should spend 1-2 hours on this task. Code should be written in python. You may use 3rd party libraries as needed. Scenario: You need to provide a service that can resize images. By service, we mean that independent software client processes should be able can ‘connect’ to the service in some way. These clients may be local (on the same machine), or (for extra points), your service could allow connections from a mixture of both local and remote clients. Note that the service should process images (single video frames), not complete videos. The service needs to scale so that many clients can use it concurrently. You might consider using message/task system architectures scale your service via distributed processing. It must be possible for multiple requests to be processed concurrently and all computational resources available should be utilised. You should try to make use of the system’s GPUs if possible. To test your service you should create a test program that uses your service to concurrently resize N instances of a video, where N is passed as a command line argument to the test application. Note we are using N instances of the same video for simplicity, in reality it would be N different videos. The scaling of each video instance should start M seconds after the previous. For example, if N = 2 and M = 10, you test should start using your service to process one instance of the video immediately, and 10 seconds later it should start using your service to process the second instance. The values of N and M will be passed as command line parameters, as will the video path. Split the video into frames and make multiple calls to your service. The test program should create N sets of output frames, saved to disk as images, e.g. /tmp/vid-instance1/Frame00001.jpg /tmp/vid-instance1/Frame00002.jpg /tmp/vid-instance1/Frame00003.jpg /tmp/vid-instance2/Frame00001.jpg /tmp/vid-instance2/Frame00002.jpg /tmp/vid-instance2/Frame00003.jpg … and so on. You should write the re-sized images to disk as soon as they have been processed (as opposed to converting all frames and then writing them to disk at the end). Make your test report runtime metrics including the frame-rate of the conversion (a running average) for each video instance, report when each video instance has been completely converted, and display the total amount of time taken for each instance. Remember, a key requirement is to process all data as quickly as possible. You will be expected to talk through your approach, explain it’s advantages and limitations, discuss what other options you considered, and what other approaches could be considered in the future. Tip: Focus on all elements of the problem – try not to get bogged down on one particular bit. It is more important to show how you tackled the problem and what solutions you have come up with rather than having 100% running code covering all aspects – although that obviously helps :). Manage your time. Please ask for any clarifications as needed.

Python 100.00%

flask_video__client_server_resize-pic's Introduction

flask_video__client_server_resize-pic

A service that can resize images- Independent software client processes able to ‘connect’ to the service in some way. These clients may be local (on the same machine), or (for extra points), the service could allow connections from a mixture of both local and remote clients. The service is process images (single video frames). The service scaled so that many clients can use it concurrently. It possible for multiple requests to be processed concurrently and all computational resources available should be utilised. To test your service you should create a test program that uses your service to concurrently resize N instances of a video, where N is passed as a command line argument to the test application. Note we are using N instances of the same video for simplicity, in reality it would be N different videos. The scaling of each video instance should start M seconds after the previous. For example, if N = 2 and M = 10, you test should start using your service to process one instance of the video immediately, and 10 seconds later it should start using your service to process the second instance. The values of N and M will be passed as command line parameters, as will the video path. Spliting the video into frames and make multiple calls to your service. The test program create N sets of output frames, saved to disk as images, e.g.
/tmp/vid-instance1/Frame00001.jpg /tmp/vid-instance1/Frame00002.jpg /tmp/vid-instance1/Frame00003.jpg /tmp/vid-instance2/Frame00001.jpg /tmp/vid-instance2/Frame00002.jpg /tmp/vid-instance2/Frame00003.jpg
… and so on. re-sized images to disk as soon as they have been processed (as opposed to converting all frames and then writing them to disk at the end). runtime metrics including the frame-rate of the conversion (a running average) for each video instance, reported when each video instance has been completely converted, display- total amount of time taken for each instance.

flask_video__client_server_resize-pic's People

Contributors

michaelein avatar

Stargazers

 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.