Skip to content

Commit

Permalink
Merge pull request #13 from pymit/doc
Browse files Browse the repository at this point in the history
video doc
  • Loading branch information
marxmit7 committed Aug 7, 2019
2 parents ebd048d + efd3eb0 commit 5c60c76
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 170 deletions.
82 changes: 82 additions & 0 deletions src/main/Homepage/doc/tabsView/VideoFR/AllReqValues.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import React from "react";
import Table from "react-bootstrap/Table";

function POSTReqTable() {
return (
<div>
<Table striped bordered hover size="sm">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>file</td>
<td>Video</td>
<td>Any video file</td>
</tr>
</tbody>
</Table>
</div>
);
}

function POSTResTable() {
return (
<div>
<Table striped bordered hover size="sm">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>Faceid</td>
<td>Array</td>
<td>
Time interval of the occurence of the corresponding
faceid
</td>
</tr>
</tbody>
</Table>
</div>
);
}

const POSTResExample = JSON.stringify(
{
face_id_1: [[0.3, 2.0], [0.8, 8.51], [22.22, 25.53], [28.63, 31.43]],
face_id_2: [
[0.1, 0.7],
[8.61, 10.41],
[11.31, 12.51],
[12.81, 22.12],
[25.63, 28.53],
[35.84, 36.24]
]
},
null,
2
);

const POSTcurlValue =
'curl -i -X POST -H "Content-Type: multipart/form-data " -F "file=@<path to video file> " http://127.0.0.1:8000/api/video/';
const POSTpythonValue =
"import requests \nvideoPath = <path to video file> \nurl = \"http://127.0.0.1:8000/api/video/\" \nfiles = {'file': open(videoPath, 'rb') }\nresponse = requests.post(url, files=files)\nprint(response.text)";
const POSTnodeValue = "";

export {
POSTResExample,
POSTReqTable,
POSTnodeValue,
POSTpythonValue,
POSTResTable,
POSTcurlValue
};
82 changes: 0 additions & 82 deletions src/main/Homepage/doc/tabsView/VideoFR/AllTabs.js

This file was deleted.

85 changes: 0 additions & 85 deletions src/main/Homepage/doc/tabsView/VideoFR/TabContents.js

This file was deleted.

25 changes: 22 additions & 3 deletions src/main/Homepage/doc/tabsView/VideoFR/VideoFR.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
import React from "react";
import { ReqRes, SnippetTab } from "./AllTabs";
import { POSTReqRes, POSTSnippetTab } from "../AllTabs";
import {
POSTResExample,
POSTReqTable,
POSTnodeValue,
POSTpythonValue,
POSTResTable,
POSTcurlValue
} from "./AllReqValues";
function VideoFR() {
return (
<div>
<ReqRes />
<SnippetTab />
<b>POST</b>
<br />
/nsfw
<POSTReqRes
ReqVal={POSTReqTable()}
ResVal={POSTResTable()}
ResExample={POSTResExample}
/>
<POSTSnippetTab
curlValue={POSTcurlValue}
pythonValue={POSTpythonValue}
nodeValue={POSTnodeValue}
/>
</div>
);
}
Expand Down

0 comments on commit 5c60c76

Please sign in to comment.