feat: 切换后端至PaddleOCR-NCNN,切换工程为CMake

1.项目后端整体迁移至PaddleOCR-NCNN算法,已通过基本的兼容性测试
2.工程改为使用CMake组织,后续为了更好地兼容第三方库,不再提供QMake工程
3.重整权利声明文件,重整代码工程,确保最小化侵权风险

Log: 切换后端至PaddleOCR-NCNN,切换工程为CMake
Change-Id: I4d5d2c5d37505a4a24b389b1a4c5d12f17bfa38c
This commit is contained in:
wangzhengyang
2022-05-10 09:54:44 +08:00
parent ecdd171c6f
commit 718c41634f
10018 changed files with 3593797 additions and 186748 deletions

View File

@ -0,0 +1,213 @@
/* Copyright (c) Microsoft Corporation. All rights reserved. */
html
{
cursor: default;
}
#featureLabel
{
font: 20pt/24pt "Segoe UI Semilight";
margin:0;
padding:5px 0 10px 0;
font-weight: normal;
}
#inputLabel, #outputLabel
{
font: 11pt/15pt "Segoe UI";
margin:0;
padding:0;
font-weight: normal;
}
#listLabel, #descLabel
{
font: 11pt/15pt "Segoe UI Semilight";
font-weight:normal;
}
#rootGrid
{
width: 100%;
height: 100%;
display: -ms-grid;
-ms-grid-columns: 100px 1fr 100px;
-ms-grid-rows: 20px auto 1fr auto 20px;
}
#header
{
-ms-grid-column: 2;
-ms-grid-row: 2;
}
#content
{
padding-right:20px;
padding-bottom:20px;
overflow:auto;
display:-ms-grid;
-ms-grid-columns:1fr;
-ms-grid-rows: auto 1fr;
-ms-grid-column: 2;
-ms-grid-row: 3;
}
#footer
{
-ms-grid-column: 2;
-ms-grid-row: 4;
padding-bottom:10px;
}
#featureLabel
{
-ms-grid-row: 1;
}
#contentHost
{
display:-ms-grid;
-ms-grid-columns:1fr;
-ms-grid-rows: auto auto auto 1fr;
-ms-grid-row: 2;
}
#inputLabel
{
-ms-grid-row: 1;
}
#input
{
-ms-grid-row: 2;
display: -ms-grid;
-ms-grid-columns: auto auto;
-ms-grid-rows: auto;
margin-top:10px;
}
#outputLabel
{
-ms-grid-row: 3;
padding-top:10px;
padding-bottom:10px;
}
#output
{
height:100%;
-ms-grid-row: 4;
-ms-grid-row-align:stretch;
}
.clear
{
clear:both;
}
#footer span
{
font-size:12px;
}
#footer .company
{
float:left;
}
#footer .links
{
float:right;
}
#footer .links a
{
font-size:12px;
margin-left:8px;
text-decoration:none;
}
#footer .links .pipe
{
font-size:9px;
margin-left:8px;
}
#statusMessage
{
margin-bottom:5px;
}
#input .options
{
-ms-grid-row: 1;
-ms-grid-column: 1;
}
#input .details
{
-ms-grid-row: 1;
-ms-grid-column: 2;
cursor:text;
}
.imageHolder
{
max-width:382px;
}
.imageHolder.withText
{
float:left;
margin-right:10px;
}
#scenarios
{
margin-right:20px;
}
@media screen and (min-width: 800px) and (max-width: 1024px)
{
#rootGrid
{
-ms-grid-columns: 40px 1fr 40px;
}
}
@media screen and (max-width: 799px)
{
#rootGrid
{
-ms-grid-columns: 20px 1fr 20px;
}
#output
{
padding-bottom:20px;
}
#input
{
-ms-grid-columns: auto;
-ms-grid-rows: auto auto;
}
#input .options
{
-ms-grid-row: 1;
-ms-grid-column: 1;
margin-bottom:10px;
}
#input .details
{
-ms-grid-row: 2;
-ms-grid-column: 1;
}
}

View File

@ -0,0 +1,204 @@
//// Copyright (c) Microsoft Corporation. All rights reserved
// This file is a part of the SDK sample framework. For code demonstrating scenarios in this particular sample,
// please see the html, css and js folders.
(function () {
//
// Helper controls used in the sample pages
//
// The ScenarioInput control inserts the appropriate markup to get labels & controls
// hooked into the input section of a scenario page so that it's not repeated in
// every one.
var lastError = "";
var lastStatus = "";
var ScenarioInput = WinJS.Class.define(
function (element, options) {
element.winControl = this;
this.element = element;
new WinJS.Utilities.QueryCollection(element)
.setAttribute("role", "main")
.setAttribute("aria-labelledby", "inputLabel");
element.id = "input";
this.addInputLabel(element);
this.addDetailsElement(element);
this.addScenariosPicker(element);
}, {
addInputLabel: function (element) {
var label = document.createElement("h2");
label.textContent = "Input";
label.id = "inputLabel";
element.parentNode.insertBefore(label, element);
},
addScenariosPicker: function (parentElement) {
var scenarios = document.createElement("div");
scenarios.id = "scenarios";
var control = new ScenarioSelect(scenarios);
parentElement.insertBefore(scenarios, parentElement.childNodes[0]);
},
addDetailsElement: function (sourceElement) {
var detailsDiv = this._createDetailsDiv();
while (sourceElement.childNodes.length > 0) {
detailsDiv.appendChild(sourceElement.removeChild(sourceElement.childNodes[0]));
}
sourceElement.appendChild(detailsDiv);
},
_createDetailsDiv: function () {
var detailsDiv = document.createElement("div");
new WinJS.Utilities.QueryCollection(detailsDiv)
.addClass("details")
.setAttribute("role", "region")
.setAttribute("aria-labelledby", "descLabel")
.setAttribute("aria-live", "assertive");
var label = document.createElement("h3");
label.textContent = "Description";
label.id = "descLabel";
detailsDiv.appendChild(label);
return detailsDiv;
},
}
);
// The ScenarioOutput control inserts the appropriate markup to get labels & controls
// hooked into the output section of a scenario page so that it's not repeated in
// every one.
var ScenarioOutput = WinJS.Class.define(
function (element, options) {
element.winControl = this;
this.element = element;
new WinJS.Utilities.QueryCollection(element)
.setAttribute("role", "region")
.setAttribute("aria-labelledby", "outputLabel")
.setAttribute("aria-live", "assertive");
element.id = "output";
this._addOutputLabel(element);
this._addStatusOutput(element);
}, {
_addOutputLabel: function (element) {
var label = document.createElement("h2");
label.id = "outputLabel";
label.textContent = "Output";
element.parentNode.insertBefore(label, element);
},
_addStatusOutput: function (element) {
var statusDiv = document.createElement("div");
statusDiv.id = "statusMessage";
statusDiv.setAttribute("role", "textbox");
element.insertBefore(statusDiv, element.childNodes[0]);
}
}
);
// Sample infrastructure internals
var currentScenarioUrl = null;
WinJS.Navigation.addEventListener("navigating", function (evt) {
currentScenarioUrl = evt.detail.location;
});
WinJS.log = function (message, tag, type) {
var isError = (type === "error");
var isStatus = (type === "status");
if (isError || isStatus) {
var statusDiv = /* @type(HTMLElement) */ document.getElementById("statusMessage");
if (statusDiv) {
statusDiv.innerText = message;
if (isError) {
lastError = message;
statusDiv.style.color = "blue";
} else if (isStatus) {
lastStatus = message;
statusDiv.style.color = "green";
}
}
}
};
// Control that populates and runs the scenario selector
var ScenarioSelect = WinJS.UI.Pages.define("/sample-utils/scenario-select.html", {
ready: function (element, options) {
var that = this;
var selectElement = WinJS.Utilities.query("#scenarioSelect", element);
this._selectElement = selectElement[0];
SdkSample.scenarios.forEach(function (s, index) {
that._addScenario(index, s);
});
selectElement.listen("change", function (evt) {
var select = evt.target;
if (select.selectedIndex >= 0) {
var newUrl = select.options[select.selectedIndex].value;
WinJS.Navigation.navigate(newUrl);
}
});
selectElement[0].size = (SdkSample.scenarios.length > 5 ? 5 : SdkSample.scenarios.length);
if (SdkSample.scenarios.length === 1) {
// Avoid showing down arrow when there is only one scenario
selectElement[0].setAttribute("multiple", "multiple");
}
// Use setImmediate to ensure that the select element is set as active only after
// the scenario page has been constructed.
setImmediate(function () {
that._selectElement.setActive();
});
},
_addScenario: function (index, info) {
var option = document.createElement("option");
if (info.url === currentScenarioUrl) {
option.selected = "selected";
}
option.text = (index + 1) + ") " + info.title;
option.value = info.url;
this._selectElement.appendChild(option);
}
});
function activated(e) {
WinJS.Utilities.query("#featureLabel")[0].textContent = SdkSample.sampleTitle;
}
WinJS.Application.addEventListener("activated", activated, false);
// Export public methods & controls
WinJS.Namespace.define("SdkSample", {
ScenarioInput: ScenarioInput,
ScenarioOutput: ScenarioOutput
});
// SDK Sample Test helper
document.TestSdkSample = {
getLastError: function () {
return lastError;
},
getLastStatus: function () {
return lastStatus;
},
selectScenario: function (scenarioID) {
scenarioID = scenarioID >> 0;
var select = document.getElementById("scenarioSelect");
var newUrl = select.options[scenarioID - 1].value;
WinJS.Navigation.navigate(newUrl);
}
};
})();

View File

@ -0,0 +1,15 @@
<!-- Copyright (c) Microsoft Corporation. All rights reserved. -->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div class="options">
<h3 id="listLabel">Select scenario:</h3>
<select id="scenarioSelect" aria-labelledby="listLabel">
<!-- scenario list is inserted here -->
</select>
</div>
</body>
</html>