This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from re import T | |
labels = ["frodo","sam","legolas","gimli","karim benzema"] | |
# Open a text file to write the bad labels to | |
with open("bad_labels.txt","w") as bad: | |
# Open the text file with all of the data in it | |
with open("test2_xml/test.txt") as file: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You can substitute out the tags for andy tags you like. | |
# The ".*" in the center of each tag specifies that any characters with any length can exist inside the tag | |
cat *.xml | grep -o -e "<name>.*<\/name>\|<filename>.*<\/filename>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import glob | |
import subprocess | |
# Replace this file directory with the location of the xml files | |
files = glob.glob('/home/isaac/Desktop/work_area/test2_xml/*.xml') | |
for xml_file in files: | |
bashCmd = ["xmllint","-format", "-o", "{}".format(xml_file), "{}".format(xml_file)] | |
process = subprocess.Popen(bashCmd, stdout=subprocess.PIPE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
A function to change an ImageProxy to a bitmap | |
@param the image input | |
@return can be null or a bitmap | |
*/ | |
fun preProcessImg(image : ImageProxy):Bitmap?{ | |
val planes = image!!.planes | |
val yBuffer = planes[0].buffer | |
val uBuffer = planes[1].buffer | |
val vBuffer = planes[2].buffer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import qualified Data.Text as T | |
import Language.Plutus.Contract hiding (when) | |
import Language.PlutusTx.Prelude | |
import Playground.Contract | |
-- | A 'Contract' that logs a message. | |
hello :: Contract BlockchainActions T.Text () | |
hello = logInfo @String "Hello, world" | |
endpoints :: Contract BlockchainActions T.Text () |
NewerOlder