Revert "adding information for image reader"
This reverts commit 5dd3b9bcb0
.
This commit is contained in:
Родитель
81595c9017
Коммит
f31bd6ee91
|
@ -898,48 +898,4 @@ std::wstring s2ws(const std::string& str);
|
|||
|
||||
std::string ws2s(const std::wstring& wstr);
|
||||
|
||||
|
||||
#ifdef __unix__
|
||||
typedef timeval LARGE_INTEGER;
|
||||
#endif
|
||||
class auto_timer
|
||||
{
|
||||
LARGE_INTEGER freq, start;
|
||||
auto_timer(const auto_timer &);
|
||||
void operator=(const auto_timer &);
|
||||
|
||||
public:
|
||||
auto_timer()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
if (!QueryPerformanceFrequency(&freq)) // count ticks per second
|
||||
RuntimeError("auto_timer: QueryPerformanceFrequency failure");
|
||||
QueryPerformanceCounter(&start);
|
||||
#endif
|
||||
#ifdef __unix__
|
||||
gettimeofday(&start, NULL);
|
||||
#endif
|
||||
}
|
||||
operator double() const // each read gives time elapsed since start, in seconds
|
||||
{
|
||||
LARGE_INTEGER end;
|
||||
#ifdef _WIN32
|
||||
QueryPerformanceCounter(&end);
|
||||
return (end.QuadPart - start.QuadPart) / (double)freq.QuadPart;
|
||||
#endif
|
||||
#ifdef __unix__
|
||||
gettimeofday(&end, NULL);
|
||||
return (end.tv_sec - start.tv_sec) + (end.tv_usec - start.tv_usec) / (1000 * 1000);
|
||||
#endif
|
||||
}
|
||||
void show(const std::string &msg) const
|
||||
{
|
||||
double elapsed = *this;
|
||||
fprintf(stderr, "%s: %.6f ms\n", msg.c_str(), elapsed * 1000.0 /*to ms*/);
|
||||
}
|
||||
};
|
||||
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4555) // expression has no affect, used so retail won't be empty
|
||||
|
||||
#endif // _FILEUTIL_
|
||||
|
|
|
@ -270,25 +270,10 @@ cv::Mat ImageDataDeserializer::ReadImage(size_t seqId, const std::string& path)
|
|||
{
|
||||
assert(!path.empty());
|
||||
|
||||
auto_timer imageTimer;
|
||||
ImageDataDeserializer::SeqReaderMap::const_iterator r;
|
||||
if (m_readers.empty() || (r = m_readers.find(seqId)) == m_readers.end())
|
||||
{
|
||||
auto ret = m_defaultReader.Read(seqId, path);
|
||||
if (m_verbose)
|
||||
{
|
||||
double imageReadTime = (double)imageTimer;
|
||||
fprintf(stderr, "ReadImage: time usage = %.8g.\n", (double) imageReadTime);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
auto ret = (*r).second->Read(seqId, path);
|
||||
if (m_verbose)
|
||||
{
|
||||
double imageReadTime = (double)imageTimer;
|
||||
fprintf(stderr, "ReadImage: time usage = %.8g.\n", (double)imageReadTime);
|
||||
}
|
||||
return ret;
|
||||
if (m_readers.empty() || (r = m_readers.find(seqId)) == m_readers.end())
|
||||
return m_defaultReader.Read(seqId, path);
|
||||
return (*r).second->Read(seqId, path);
|
||||
}
|
||||
|
||||
cv::Mat FileByteReader::Read(size_t, const std::string& path)
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include "ByteReader.h"
|
||||
#include "ImageConfigHelper.h"
|
||||
#include <unordered_map>
|
||||
#include <fileutil.h>
|
||||
|
||||
namespace Microsoft { namespace MSR { namespace CNTK {
|
||||
|
||||
|
@ -67,7 +66,6 @@ private:
|
|||
SeqReaderMap m_readers;
|
||||
|
||||
FileByteReader m_defaultReader;
|
||||
int m_verbose;
|
||||
};
|
||||
|
||||
}}}
|
||||
|
|
Загрузка…
Ссылка в новой задаче