Skip to content

Qc script #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 94 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
d827f1e
QC Script Initial Testing
SoFrans Oct 9, 2023
314b2bc
Testing
SoFrans Oct 11, 2023
0258ca3
working on getting into dataframe
SoFrans Oct 12, 2023
18ad185
working on dataframes
SoFrans Oct 18, 2023
f33b574
QCScriptWork
SoFrans Oct 19, 2023
f033dc8
Reorganizing and some script work
SoFrans Oct 25, 2023
d4adc07
QC Script Work
SoFrans Oct 25, 2023
d2fd39e
QC Script Edits
SoFrans Oct 26, 2023
c97a60b
QCScript Work
SoFrans Oct 26, 2023
690e01f
Adding contributers to README
SoFrans Oct 26, 2023
a238835
Update README.md
SoFrans Oct 27, 2023
e486a94
Update README.md
SoFrans Oct 27, 2023
d07fc18
Updated example xml name
SoFrans Oct 27, 2023
5b23677
Updates
SoFrans Oct 30, 2023
92a4882
Developing the frame by frame report
SoFrans Oct 30, 2023
f3efaef
Updating pandas df
SoFrans Nov 1, 2023
8c0455f
Update README
SoFrans Nov 1, 2023
c73146c
Updates
SoFrans Nov 1, 2023
1e7838a
Added Bit Options to README
SoFrans Nov 1, 2023
139852e
Updates
SoFrans Nov 2, 2023
4dd1fb4
Better value range organization
SoFrans Nov 2, 2023
0c2fcaf
Organizing and building LowCheck
SoFrans Nov 2, 2023
4bfeeba
Analysis Additions
SoFrans Nov 2, 2023
8def0d2
Updates
SoFrans Nov 2, 2023
a82a541
Updates
SoFrans Nov 3, 2023
4459a37
Updates
SoFrans Nov 3, 2023
07f0d21
Reorganizing
SoFrans Nov 3, 2023
8abc411
Updates
SoFrans Nov 3, 2023
8f5d2cc
fix
SoFrans Nov 6, 2023
7c28444
Merge branch 'QCScript' of https://github.com/nulib/nul-rdc-scripts i…
SoFrans Nov 6, 2023
99cb543
Minor updates
SoFrans Nov 6, 2023
b00959b
Working on TOUT and VREP Reporting
SoFrans Nov 6, 2023
5b812fe
Fixes and Updating TOUT VREP
SoFrans Nov 8, 2023
4d2289a
Update README to include Dave Rice
SoFrans Nov 10, 2023
cae8449
AddingSummarizationStatsEquations
SoFrans Nov 13, 2023
c08cfae
Update README.md
SoFrans Nov 13, 2023
daf9edb
Update README.md
SoFrans Nov 13, 2023
9e4a640
Update summarizationStats.md
SoFrans Nov 13, 2023
3821e28
Updates
SoFrans Nov 15, 2023
4f96c5c
Updates
SoFrans Nov 20, 2023
f11ec77
Merge branch 'QCScript' of https://github.com/nulib/nul-rdc-scripts i…
SoFrans Nov 20, 2023
383cc3c
Updates
SoFrans Nov 21, 2023
b7f90de
Update README.md
SoFrans Nov 21, 2023
59caa17
Update .gitignore
SoFrans Nov 21, 2023
c65129d
Update .gitignore
SoFrans Nov 21, 2023
3d46bfb
Merge branch 'QCScript' of https://github.com/nulib/nul-rdc-scripts i…
SoFrans Nov 21, 2023
71a0c19
Create VideoStandardsfor8Bit
SoFrans Nov 21, 2023
e7f18f4
Merge branch 'main' into QCScript
SoFrans Nov 21, 2023
9858ead
Placing into new staging folder
SoFrans Nov 21, 2023
0183411
temporarily changed file name
SoFrans Nov 21, 2023
82e6656
Updates
SoFrans Nov 27, 2023
0f76133
Updates
SoFrans Nov 27, 2023
46270e9
Updates
SoFrans Nov 27, 2023
0eb7faa
updates
SoFrans Nov 28, 2023
7ba92ca
fixed argparse?
SoFrans Nov 29, 2023
2ec46d8
Updating parser
SoFrans Nov 29, 2023
97e16fb
Adding Schema. Adding Karen to README list contrib
SoFrans Dec 4, 2023
a1cac39
updates
SoFrans Dec 6, 2023
3085a91
biggerparser
SoFrans Dec 18, 2023
5bdf157
Now supports BIG XML files
SoFrans Dec 20, 2023
c588368
True Dataparsing file now supports huge xml files
SoFrans Dec 20, 2023
5e1a6bd
Getting rid of old junk
SoFrans Dec 20, 2023
36347b0
updates
SoFrans Jan 3, 2024
dbcece7
Minor updates
SoFrans Feb 8, 2024
ba8ed6d
Updates
SoFrans Feb 20, 2024
2ef15ac
Updates
SoFrans Feb 28, 2024
418cb3e
Updates
SoFrans Feb 28, 2024
c3f2b83
Updates
SoFrans Feb 29, 2024
7384352
Swapping out Progress Bar
SoFrans Mar 1, 2024
ff3f1ce
Update
SoFrans Mar 1, 2024
7fc6d8a
finished? full video analyses
SoFrans Mar 22, 2024
78a2861
updates
SoFrans Mar 25, 2024
64ceabc
update
SoFrans Mar 25, 2024
5c92059
it works
SoFrans Mar 25, 2024
4725afb
minor fixes
SoFrans Mar 25, 2024
d1b8e96
fixedoutputcheckyuv
SoFrans Mar 26, 2024
11a2b0a
update
SoFrans Mar 26, 2024
412e283
updates
SoFrans Mar 26, 2024
4f0ff53
Need to check
SoFrans Mar 27, 2024
e625977
FrameByFrameWork
SoFrans Mar 28, 2024
a4c9c19
FramebyFrameStats Build Done
SoFrans Mar 29, 2024
b5bbc31
Now FbyF and Full Video completely functional
SoFrans Mar 29, 2024
a2468ac
FixJSONonlyFails
SoFrans Apr 8, 2024
aeb132d
DisconnectedFromTestfiles
SoFrans Apr 8, 2024
97861e1
updates
SoFrans May 15, 2024
b0a4476
update
SoFrans May 15, 2024
ef69f7d
update
SoFrans May 15, 2024
ad829e9
updates
SoFrans May 16, 2024
c6d2471
updates
SoFrans May 17, 2024
1c82f13
updates
SoFrans May 17, 2024
284aae5
updates
SoFrans May 28, 2024
e214b8b
updates
SoFrans Apr 8, 2025
075dd57
Starting to Build Tool
SoFrans Apr 10, 2025
946fb42
Development continued
SoFrans Apr 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"githubPullRequests.ignoredPullRequestBranches": [
"main"
]
],
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
},
"python.formatting.provider": "none"
}
1 change: 1 addition & 0 deletions audiodata.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
""
8 changes: 8 additions & 0 deletions nulrdcscripts/staging/vqc/QCScript.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import videoanalyses.fbyfYUV as fbyfYUV
from setupsteps import setup

videoBitDepth = setup.setVideoBitDepth("--10bit")
videoBitDepth = setup.setvideobitdepthstandard(videoBitDepth)
videodata = "data\data.txt"

errors = fbyfYUV.checkerrors(videodata, videoBitDepth)
36 changes: 36 additions & 0 deletions nulrdcscripts/staging/vqc/data/ReferenceData10Bit.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
10 Bit Data Ranges for Average Videos

Digital Luma Range: 64-940
Digital Chroma Range: 64 - 960
Ideal U & V Range: 340 - 680
Yav: ~512
Yrang: ~516 - 876
Uav: ~512
Vav: ~512
TOUT: 0 - 0.009
TOUTc: <10
SAT Ideal Range: 0 - 88.7
SATb: <1000 frames
SATi: <1000 frames
Hue Ideal Range: 480 - 588 (for skin tones)
BRNGav: <0.02
BRNGc: <1000
MSEf: ~0
MSEfY: <10
VREP Ideal: 0

Y Channel Range: 0-1020 IRE
Y Channel Ideal Range: 64 - 940 IRE
Y LOW : 64 IRE
Y AVG : 512 IRE
Y HIGH : 940 IRE

U Channel Ideal Range: 340 - 680 IRE
V Channel Ideal Range: 340 - 680 IRE


YUV Diff : Closer to 0 the better

SAT Ideal RAnge: 0 - 354.8


10 changes: 10 additions & 0 deletions nulrdcscripts/staging/vqc/data/dataframe.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import pandas as pd

csv = "Video8BitValues.csv"

df = pd.read_csv(csv, index_col="criteria")
criteriaToCheck = "brngout"
criteria = "uhigh"
extraction = df.at[criteria, criteriaToCheck]

print(extraction)
4 changes: 4 additions & 0 deletions nulrdcscripts/staging/vqc/data/severityLevels.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
vrep = "CRITICAL"
tout = "CRITICAL"
brngout = "MODERATE"
clipping = "CRITICAL"
90 changes: 90 additions & 0 deletions nulrdcscripts/staging/vqc/data/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import videovalues10Bit

videodata = "baddata.csv"


def runLOW(criteria):
criteria = criteria + "low"
return criteria


def runHIGH(criteria):
criteria = criteria + "high"
return criteria


def checkLOWHIGH(videodata, videoBitDepth, fullCriteria):
criteriaBRNG = videoBitDepth.get(fullCriteria["BRNG"])
criteriaClipping = videoBitDepth.get(fullCriteria["clipping"])
selectColumns = "" + fullCriteria + "," + "Frame Time" + ""
BRNGErrors = setAndRunBRNG(criteriaBRNG, fullCriteria, selectColumns, videodata)
clippingErrors = setAndRunClipping(
criteriaClipping, fullCriteria, selectColumns, videodata
)

if BRNGErrors.isEmpty and clippingErrors.isEmpty:
pass
elif BRNGErrors.isEmpty or clippingErrors.isEmpty:
if BRNGErrors.isEmpty:
videoYUVErrors = clippingErrors
else:
videoYUVErrors = BRNGErrors
else:
videoYUVErrors = [clippingErrors, BRNGErrors]
return videoYUVErrors


def setAndRunClipping(criteria, criteriaClipping, selectColumns, videodata):
criteriaEquation = "" + criteria + "==" + criteriaClipping + ""
clippingErrors = {}
subDF = videodata[[selectColumns]]

clippingErrors = subDF.query(criteriaEquation)
if subDF.empty:
pass
else:
if criteria.contains("low"):
errortype = "Low Clipping"
elif criteria.contains("high"):
errortype = "High Clipping"
clippingErrors.assign(errortype)

return clippingErrors


def setAndRunBRNG(criteria, criteriaBRNG, selectColumns, videodata):
if criteria.contains("low"):
firstOp = "=<"
clipVal = 0
elif criteria.contains("high"):
firstOp = ">="
clipVal = 1023
criteriaEquation = (
"" + criteria + firstOp + criteriaBRNG + "&" + criteria + "!=" + clipVal + ""
)
BRNGErrors = {}
subDF = videodata[[selectColumns]]

BRNGErrors = subDF.query(criteriaEquation)
if BRNGErrors.isEmpty:
pass
else:
if criteria.contains("low"):
errortype = "Low BRNG"
elif criteria.contains("high"):
errortype = "High BRNG"
BRNGErrors.assign(errortype)
return BRNGErrors


def check():
videodata = "baddata.csv"
criteria = "Y"
videoBitDepth = videovalues10Bit
fullCriteria = runLOW(criteria)
checkLOWHIGH(videodata, videoBitDepth, fullCriteria)
fullCriteria = runHIGH(criteria)
checkLOWHIGH(videodata, videoBitDepth, fullCriteria)


check()
59 changes: 59 additions & 0 deletions nulrdcscripts/staging/vqc/docs/continue.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import pandas as pd
import xml.etree.ElementTree as etree
import cleaners

audiodata = {}
videodata = {}
framenumberA = 0
framenumberV = 0


file = input("file")
data = "data.json"
tree = etree.parse(file)
root = tree.getroot()


for event, elem in etree.iterparse(file, events=["start", "end"]):
if event == "start":
if elem.tag == "frame":
if elem.get("media_type") == "audio":
framenumberA = framenumberA + 1
frametime = elem.get("pkt_pts_time")
audiodata[framenumberA] = {}
for tag in elem.iter("tag"):
criteria = tag.attrib["key"]
criteria = cleaners.criteriacleaner(criteria)
value = tag.attrib["value"]
audiodata[framenumberA]["Frame Time"] = float(frametime)
audiodata[framenumberA][criteria] = value
else:
pass
else:
pass
elif event == "end":
elem.clear()


for event, elem in etree.iterparse(file, events=["end"]):
if event == "end":
if elem.tag == "frame":
if elem.get("media_type") == "video":
framenumberV = framenumberV + 1
frametime = elem.get("pkt_pts_time")
videodata[framenumberV] = {}
for tag in elem.iter("tag"):
criteria = tag.attrib["key"]
criteria = cleaners.criteriacleaner(criteria)
value = tag.attrib["value"]
videodata[framenumberV]["Frame Time"] = float(frametime)
videodata[framenumberV][criteria] = float(value)
elem.clear()

dfAudio = pd.DataFrame.from_dict(audiodata)
dfAudio = dfAudio.transpose()
dfAudio.to_csv("audiodata.csv", sep=",")

dfVideo = pd.DataFrame.from_dict(videodata)
dfVideo = dfVideo.transpose()
dfVideo.to_csv("videodatashort.csv", sep=",")
36 changes: 36 additions & 0 deletions nulrdcscripts/staging/vqc/docs/summarizationStats.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
## Standards from QC Tools that have been altered for this script

|Criteria|Original Value|
|:---:|:---:|
|TOUTc|<10 frames|
|SATb|<1000 frames|
|SATi|<1000 frames|
|BRNGc|<1000 frames|
|MSEfY|<10 frames|


## Knowns (rounded frames per second)

30 frames/sec <br>
3,600 sec/hr <br>
108,000 frames/hr

### Calculations for TOUTc and MSEfY
Equation: 10/((3600*timeHRs) \* 30) (This makes no sense as the values are E<sup>-5</sup>)

### Calculations for SATb, SATi, BRNGc
Equation: 1000/((3600*timeHRs) \* 30)

#### If we can assume that the 1000 benchmark value came from a video in the range of 1-2 hrs

|Time|Percent Error Allowed Exact| Percent Error Allowed Rounded|
|:---:|:---:|:---:|
1 hr|0.92592593%|0.93%
1.25 hr|0.74074074%|0.74%
1.5 hr|0.61728395%|0.62%
1.75 hr| 0.52910053%|0.53%
2 hr|0.4629629%|0.46%
||
AVG| 0.65520282%|0.66%

Theoretically 0.66% of the videos frames are allowed to be greater
Empty file.
Loading