Skip to content

Commit

Permalink
Merge branch 'tensorflow-upgrade' of github.com:smistad/FAST into ten…
Browse files Browse the repository at this point in the history
…sorflow-upgrade
  • Loading branch information
smistad committed Dec 2, 2020
2 parents b8a12fc + cbac73c commit b0073f9
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 31 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@
[![GitHub Downloads](https://img.shields.io/github/downloads/smistad/FAST/total?label=GitHub%20downloads&logo=github)](https://github.com/smistad/FAST/releases)
[![Pip Downloads](https://img.shields.io/pypi/dm/pyfast?label=pip%20downloads&logo=python)](https://pypi.org/project/pyFAST/)

FAST (Framework for Heterogeneous Medical Image Computing and Visualization) is an open-source cross-platform framework with the main goal of making it easier to do high performance processing and visualization of medical images on heterogeneous systems utilizing both multi-core CPUs and GPUs. To achieve this, FAST is constructed using modern C++, OpenCL and OpenGL.
FAST is an open-source cross-platform framework with the main goal of making it easier to do high performance processing and visualization of medical images on heterogeneous systems utilizing both multi-core CPUs and GPUs. To achieve this, FAST use modern C++, OpenCL and OpenGL.

### Get started
First, make sure you have the [requirements installed](https://github.com/smistad/FAST/wiki/Requirements).
Stable binary releases can be [downloaded for Windows and Ubuntu Linux on GitHub](https://github.com/smistad/FAST/releases/).
Stable binary releases/installers can be [downloaded for Windows and Ubuntu Linux on GitHub](https://github.com/smistad/FAST/releases/).

To start using the framework, see the [Getting started with FAST](https://github.com/smistad/FAST/wiki/Getting-started-with-FAST) guide or the [examples page](https://github.com/smistad/FAST/wiki/Examples).

FAST is available for Python 3 through [pip](https://pypi.org/project/pyFAST/): ```pip install pyfast```
FAST is also available for Python 3 through [pip](https://pypi.org/project/pyFAST/): ```pip install pyfast```
Python examples can be found [here](https://github.com/smistad/FAST/wiki/Examples#Python).

Need help? Use the gitter chat: [![Join the chat on Gitter](https://img.shields.io/gitter/room/smistad/fast?logo=gitter)](https://gitter.im/smistad/FAST)

### Main features

* **Data streaming** – Processing pipelines in FAST can handle both static and dynamic/temporal data without any change to the code. FAST can stream data from movie files, your webcamera, an Intel RealSense camera, a sequence of images and even directly from ultrasound scanners.
* **Data streaming** – Processing pipelines in FAST can handle both static and dynamic/temporal data without any change to the code. FAST can stream data from movie files, your webcamera, an Intel RealSense camera, a sequence of images and even directly from ultrasound scanners such as Clarius.
* **Deep learning** – FAST supports several inference engines, such as Google’s TensorFlow, NVIDIA's TensorRT and Intel's OpenVINO, making it possible to create real-time neural network pipelines.
* **High-level data management** – Data objects in FAST represent data, such as an image, on all processors. FAST keeps data coherent across the different storage areas thereby removing the burden of explicit memory handling from the developer.
* **High performance algorithms** – FAST has several high performance parallel OpenCL implementations of common algorithms, such as marching cubes surface extraction, Gaussian smoothing, non-local means, block matching tracking and seeded region growing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,26 +179,19 @@ void TensorFlowEngine::run() {


void TensorFlowEngine::load() {
const auto networkFilename = getFilename();
// Setup tensorflow session options
tensorflow::SessionOptions options;
tensorflow::ConfigProto &config = options.config;
#ifndef WIN32
// These lines cause linking issues on windows
config.mutable_gpu_options()->set_allow_growth(true); // Set this so that tensorflow will not use up all GPU memory
if (m_deviceType == InferenceDeviceType::CPU) {
config.mutable_gpu_options()->set_visible_device_list("");
config.mutable_gpu_options()->set_visible_device_list(""); // Hide devices to force CPU execution
} else if (m_deviceIndex >= 0) {
config.mutable_gpu_options()->set_visible_device_list(std::to_string(m_deviceIndex));
config.mutable_gpu_options()->set_visible_device_list(std::to_string(m_deviceIndex)); // Use specific GPU
}
#endif
/*
tensorflow::GPUOptions* gpuOptions = config.mutable_gpu_options();
gpuOptions->set_allow_growth(true);
//gpuOptions->set_per_process_gpu_memory_fraction(0.5);
*/

tensorflow::GraphDef tensorflow_graph;

const auto networkFilename = getFilename();
if(networkFilename.substr(networkFilename.size()-3) == ".pb" || tensorflow::MaybeSavedModelDirectory(networkFilename) == false) {
// Load a frozen protobuf file (.pb)
if(!fileExists(networkFilename))
Expand Down
28 changes: 14 additions & 14 deletions source/FAST/PipelineEditor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,25 @@ class FAST_EXPORT PipelineEditor : public QWidget {
};


class PipelineHighlighter : public QSyntaxHighlighter {
class FAST_EXPORT PipelineHighlighter : public QSyntaxHighlighter {
Q_OBJECT

public:
PipelineHighlighter(QTextDocument* parent = 0);
public:
PipelineHighlighter(QTextDocument* parent = 0);

protected:
void highlightBlock(const QString& text) override;
protected:
void highlightBlock(const QString& text) override;

private:
struct HighlightingRule {
QRegularExpression pattern;
QTextCharFormat format;
};
QVector<HighlightingRule> highlightingRules;
private:
struct HighlightingRule {
QRegularExpression pattern;
QTextCharFormat format;
};
QVector<HighlightingRule> highlightingRules;

QTextCharFormat keywordFormat;
QTextCharFormat singleLineCommentFormat;
QTextCharFormat quotationFormat;
QTextCharFormat keywordFormat;
QTextCharFormat singleLineCommentFormat;
QTextCharFormat quotationFormat;
};

}
Expand Down
5 changes: 3 additions & 2 deletions source/FAST/Visualization/View.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "SimpleWindow.hpp"
#include "FAST/Utility.hpp"
#include <QGLFunctions>
#include <algorithm>

#if defined(__APPLE__) || defined(__MACOSX)
#include <OpenCL/cl_gl.h>
Expand Down Expand Up @@ -45,8 +46,8 @@ void View::addRenderer(Renderer::pointer renderer) {

void View::removeRenderer(Renderer::pointer rendererToRemove) {
std::lock_guard<std::mutex> lock(m_mutex);
mVolumeRenderers.erase(std::find(mVolumeRenderers.begin(), mVolumeRenderers.end(), rendererToRemove));
mNonVolumeRenderers.erase(std::find(mNonVolumeRenderers.begin(), mNonVolumeRenderers.end(), rendererToRemove));
mVolumeRenderers.erase(std::remove(mVolumeRenderers.begin(), mVolumeRenderers.end(), rendererToRemove), mVolumeRenderers.end());
mNonVolumeRenderers.erase(std::remove(mNonVolumeRenderers.begin(), mNonVolumeRenderers.end(), rendererToRemove), mNonVolumeRenderers.end());
}

void View::removeAllRenderers() {
Expand Down

0 comments on commit b0073f9

Please sign in to comment.