文档服务地址:http://47.92.0.57:3000/ 周报索引地址:http://47.92.0.57:3000/s/NruNXRYmV

Commit c17cd94a by 张欣玥

image打分功能

parent 72b14cf7
...@@ -50,11 +50,6 @@ ...@@ -50,11 +50,6 @@
<div> <div>
<div class="img-list-title" style="height: 30px;line-height: 30px;font-size: 14px">标注描述</div> <div class="img-list-title" style="height: 30px;line-height: 30px;font-size: 14px">标注描述</div>
<div style="font-size:14px;margin: 5px;text-align: left">{{this.description}}</div> <div style="font-size:14px;margin: 5px;text-align: left">{{this.description}}</div>
<!-- <div class="img-title-list-box">-->
<!-- <div v-for="(item, index) in data" :key="item.id" style="text-align: left" class="listLeft" @click="jumpToImage(index)">-->
<!-- {{index+1}}. &nbsp; {{item.label}}-->
<!-- </div>-->
<!-- </div>-->
</div> </div>
</div> </div>
</div> </div>
...@@ -65,16 +60,28 @@ ...@@ -65,16 +60,28 @@
<div class="img-list-title" style="height: 30px;line-height: 30px;font-size: 14px">标注列表</div> <div class="img-list-title" style="height: 30px;line-height: 30px;font-size: 14px">标注列表</div>
<div class="img-title-list-box"> <div class="img-title-list-box">
<div id="img-title-list" style="user-select:none"> <div id="img-title-list" style="user-select:none">
<div v-for="(item, index) in data[pictureId].children"
<div v-for="(item, index) in data[pictureId].children" :key="item.id" class="listLeft" style="text-align: left" @dblclick="labelInfo(index)" @mouseenter="labelEnter(index)" @mouseleave="labelLeave()"> :key="item.id"
class="listLeft"
style="text-align: left"
@dblclick="labelInfo(index)"
@mouseenter="labelEnter(index)"
@mouseleave="labelLeave()">
{{index+1}}. &nbsp; {{item.labelName}} {{index+1}}. &nbsp; {{item.labelName}}
<button style="float: right"
v-show = "canvasAllCheck[index] == 2"
@click="isRightFn2(index)">取消错误</button>
<button style="float: right"
v-show = "canvasAllCheck[index] == 0"
@click="isRightFn(index)">标记错误</button>
</div>
<div style="position: absolute;bottom: 0;">
<button @click="computeFn()">开始计算</button>
计算得分 = {{this.computeScore}}
</div> </div>
<!-- <el-tree-->
<!-- :data="data"-->
<!-- :props="defaultProps"-->
<!-- node-key="id"-->
<!-- @node-click="handleNodeClick">-->
<!-- </el-tree>-->
</div> </div>
</div> </div>
</div> </div>
...@@ -153,6 +160,7 @@ export default { ...@@ -153,6 +160,7 @@ export default {
name: 'imageAnnotation', name: 'imageAnnotation',
data () { data () {
return { return {
computeScore: 0,
labelNow: 0, labelNow: 0,
labelName: '111', labelName: '111',
labelPosition: '', labelPosition: '',
...@@ -177,6 +185,7 @@ export default { ...@@ -177,6 +185,7 @@ export default {
}, },
// 所有标记历史记录 // 所有标记历史记录
canvasAll: [], canvasAll: [],
canvasAllCheck: [],
// 画多边形的临时数据 // 画多边形的临时数据
createPTmp: [], createPTmp: [],
imageNum: -1, imageNum: -1,
...@@ -279,27 +288,18 @@ export default { ...@@ -279,27 +288,18 @@ export default {
var indexPic = index var indexPic = index
element.children.forEach(function (element) { element.children.forEach(function (element) {
// console.log('还原记录start')
// console.log(element)
var num = [] var num = []
element.pointList.forEach(function (element1) { element.pointList.forEach(function (element1) {
// console.log('pointlist')
// console.log(element1)
num.push(element1.X) num.push(element1.X)
num.push(element1.Y) num.push(element1.Y)
}) })
// var r1 = element.pointList[0].X
// var r2 = element.pointList[0].Y
// var rx = element.pointList[1].X
// var ry = element.pointList[1].Y
// var num = [r1, r2, rx, ry]
// console.log(num)
_this.canvasAll[indexPic].push(num) _this.canvasAll[indexPic].push(num)
_this.canvasAllCheck.push(0)
}) })
}) })
// 还原标注 // 还原标注
_this.restoreCanvas()
_this.restoreCanvas()
_this.brush_Listener() _this.brush_Listener()
} }
this.pictureId = 0 this.pictureId = 0
...@@ -317,7 +317,7 @@ export default { ...@@ -317,7 +317,7 @@ export default {
created () { created () {
}, },
beforeRouteLeave: function (to, from , next) { beforeRouteLeave: function (to, from, next) {
// alert("返回后未保存的标注结果将会消失,请确认已保存!") // alert("返回后未保存的标注结果将会消失,请确认已保存!")
if (!this.hasSaved) { if (!this.hasSaved) {
let i = 0 let i = 0
...@@ -335,16 +335,6 @@ export default { ...@@ -335,16 +335,6 @@ export default {
this.$destroy() this.$destroy()
next() next()
} }
// var _this = this;
// setTimeout(function () {
// if (i == 0) {
// _this.$destroy()
// next()
// }
// },500)
// this.$destroy();
// next();
}, },
watch: { watch: {
radio1: function f () { radio1: function f () {
...@@ -362,7 +352,6 @@ export default { ...@@ -362,7 +352,6 @@ export default {
methods: { methods: {
open () { open () {
// 弹窗提示 // 弹窗提示
}, },
// 还原标注 // 还原标注
restoreCanvas () { restoreCanvas () {
...@@ -580,6 +569,7 @@ export default { ...@@ -580,6 +569,7 @@ export default {
children.splice(index, 1) children.splice(index, 1)
// 从历史记录里删 // 从历史记录里删
this.canvasAll[id].splice(index, 1) this.canvasAll[id].splice(index, 1)
this.canvasAllCheck.splice(index, 1)
// 重画标注 // 重画标注
this.restoreCanvas() this.restoreCanvas()
...@@ -780,7 +770,6 @@ export default { ...@@ -780,7 +770,6 @@ export default {
} }
}, },
async getLabelList () { async getLabelList () {
try { try {
this.data = [] this.data = []
let params = { let params = {
...@@ -838,7 +827,7 @@ export default { ...@@ -838,7 +827,7 @@ export default {
this.data.push(newData) this.data.push(newData)
// console.log('formexchange') // console.log('formexchange')
// console.log(this.data) // console.log(this.data)
//imageNum这个虽然没啥用,但是先放着吧 // imageNum这个虽然没啥用,但是先放着吧
this.imageNum = 1 this.imageNum = 1
} }
}, },
...@@ -966,6 +955,7 @@ export default { ...@@ -966,6 +955,7 @@ export default {
let id = _this.pictureId let id = _this.pictureId
_this.createP(e, 'end', r1, r2) _this.createP(e, 'end', r1, r2)
_this.canvasAll[id].push(_this.createPTmp) _this.canvasAll[id].push(_this.createPTmp)
_this.canvasAllCheck.push(1)
_this.addLabel() _this.addLabel()
_this.restoreCanvas() _this.restoreCanvas()
_this.createPTmp = [] _this.createPTmp = []
...@@ -1021,7 +1011,7 @@ export default { ...@@ -1021,7 +1011,7 @@ export default {
_this.ctx.beginPath() _this.ctx.beginPath()
_this.ctx.fillStyle = 'rgba(51,135,255,0.54)' _this.ctx.fillStyle = 'rgba(51,135,255,0.54)'
_this.ctx.fillRect(r1, r2, rx, ry) _this.ctx.fillRect(r1, r2, rx, ry)
console.log(r1+' '+r2+' '+rx+' '+ry) console.log(r1 + ' ' + r2 + ' ' + rx + ' ' + ry)
// _this.ctx.stroke() // _this.ctx.stroke()
// 把每个标注画出来 // 把每个标注画出来
...@@ -1032,6 +1022,9 @@ export default { ...@@ -1032,6 +1022,9 @@ export default {
console.log('num') console.log('num')
console.log(num) console.log(num)
_this.canvasAll[id].push(num) _this.canvasAll[id].push(num)
_this.canvasAllCheck.push(1)
_this.addLabel() _this.addLabel()
_this.restoreCanvas() _this.restoreCanvas()
...@@ -1084,6 +1077,38 @@ export default { ...@@ -1084,6 +1077,38 @@ export default {
} }
} }
}, },
isRightFn (index) {
var tmp = this.canvasAllCheck
// alert(tmp[id])
tmp[index] = 2
this.$forceUpdate()
},
isRightFn2 (index) {
var tmp = this.canvasAllCheck
// alert(tmp[id])
tmp[index] = 0
this.$forceUpdate()
},
computeFn () {
// alert("start!")
// 0=>标注者标对的,1=>审查者后加的,2=>标错的
var yesAll = 0
var yesTmp = 0
this.canvasAllCheck.forEach(e =>{
if(e === 0) {
yesAll++;
yesTmp++;
}
else if(e === 1) {
yesAll++;
}
})
var score = yesTmp / yesAll;
this.computeScore = score * 100
},
save () { save () {
// 先把格式转换回去 // 先把格式转换回去
var outputData = [] var outputData = []
......
...@@ -23,6 +23,8 @@ import imageAnnotiation from '../components/imageAnnotation/imageAnnotiation' ...@@ -23,6 +23,8 @@ import imageAnnotiation from '../components/imageAnnotation/imageAnnotiation'
import layerAnnotation from '../components/imageAnnotation/layerAnnotation' import layerAnnotation from '../components/imageAnnotation/layerAnnotation'
import layerShow from '../components/imageAnnotation/layerShow' import layerShow from '../components/imageAnnotation/layerShow'
import imageShow from '../components/imageAnnotation/imageShow' import imageShow from '../components/imageAnnotation/imageShow'
import imageCheck from '../components/imageAnnotation/imageCheck'
import layerCheck from '../components/imageAnnotation/layerCheck'
Vue.use(Router) Vue.use(Router)
...@@ -134,16 +136,16 @@ export default new Router({ ...@@ -134,16 +136,16 @@ export default new Router({
name: 'layer', name: 'layer',
component: layerAnnotation component: layerAnnotation
}, },
// { {
// path: '/imageshow', path: '/imageCheck/:file/:task/:relationId/:piece',
// name: 'imageShow', name: 'imageCheck',
// component: imageShow component: imageCheck
// }, },
// { {
// path: '/layershow', path: '/layerCheck/:file/:task/:relationId/:piece',
// name: 'layerShow', name: 'layerCheck',
// component: layerShow component: layerCheck
// } },
{ {
path: '/imageshow/:file/:task/:relationId/:executor/:piece', path: '/imageshow/:file/:task/:relationId/:executor/:piece',
name: 'imageShow', name: 'imageShow',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment