1205 lines
79 KiB
JSON
1205 lines
79 KiB
JSON
![]() |
[
|
|||
|
{
|
|||
|
"label": "json",
|
|||
|
"kind": 6,
|
|||
|
"isExtraImport": true,
|
|||
|
"importPath": "json",
|
|||
|
"description": "json",
|
|||
|
"detail": "json",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "stringify",
|
|||
|
"importPath": "flatted",
|
|||
|
"description": "flatted",
|
|||
|
"isExtraImport": true,
|
|||
|
"detail": "flatted",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "parse",
|
|||
|
"importPath": "flatted",
|
|||
|
"description": "flatted",
|
|||
|
"isExtraImport": true,
|
|||
|
"detail": "flatted",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "stringify",
|
|||
|
"importPath": "flatted",
|
|||
|
"description": "flatted",
|
|||
|
"isExtraImport": true,
|
|||
|
"detail": "flatted",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "parse",
|
|||
|
"importPath": "flatted",
|
|||
|
"description": "flatted",
|
|||
|
"isExtraImport": true,
|
|||
|
"detail": "flatted",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "time",
|
|||
|
"kind": 6,
|
|||
|
"isExtraImport": true,
|
|||
|
"importPath": "time",
|
|||
|
"description": "time",
|
|||
|
"detail": "time",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "argparse",
|
|||
|
"kind": 6,
|
|||
|
"isExtraImport": true,
|
|||
|
"importPath": "argparse",
|
|||
|
"description": "argparse",
|
|||
|
"detail": "argparse",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "os",
|
|||
|
"kind": 6,
|
|||
|
"isExtraImport": true,
|
|||
|
"importPath": "os",
|
|||
|
"description": "os",
|
|||
|
"detail": "os",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "subprocess",
|
|||
|
"kind": 6,
|
|||
|
"isExtraImport": true,
|
|||
|
"importPath": "subprocess",
|
|||
|
"description": "subprocess",
|
|||
|
"detail": "subprocess",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "signal",
|
|||
|
"kind": 6,
|
|||
|
"isExtraImport": true,
|
|||
|
"importPath": "signal",
|
|||
|
"description": "signal",
|
|||
|
"detail": "signal",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "NodeStrategy",
|
|||
|
"importPath": "ros2cli.node.strategy",
|
|||
|
"description": "ros2cli.node.strategy",
|
|||
|
"isExtraImport": true,
|
|||
|
"detail": "ros2cli.node.strategy",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "get_topic_names_and_types",
|
|||
|
"importPath": "ros2topic.api",
|
|||
|
"description": "ros2topic.api",
|
|||
|
"isExtraImport": true,
|
|||
|
"detail": "ros2topic.api",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "shutil",
|
|||
|
"kind": 6,
|
|||
|
"isExtraImport": true,
|
|||
|
"importPath": "shutil",
|
|||
|
"description": "shutil",
|
|||
|
"detail": "shutil",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "os.path",
|
|||
|
"kind": 6,
|
|||
|
"isExtraImport": true,
|
|||
|
"importPath": "os.path",
|
|||
|
"description": "os.path",
|
|||
|
"detail": "os.path",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "Path",
|
|||
|
"importPath": "pathlib",
|
|||
|
"description": "pathlib",
|
|||
|
"isExtraImport": true,
|
|||
|
"detail": "pathlib",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "Path",
|
|||
|
"importPath": "pathlib",
|
|||
|
"description": "pathlib",
|
|||
|
"isExtraImport": true,
|
|||
|
"detail": "pathlib",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "Path",
|
|||
|
"importPath": "pathlib",
|
|||
|
"description": "pathlib",
|
|||
|
"isExtraImport": true,
|
|||
|
"detail": "pathlib",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "train_YoloV8",
|
|||
|
"importPath": "train_Yolo",
|
|||
|
"description": "train_Yolo",
|
|||
|
"isExtraImport": true,
|
|||
|
"detail": "train_Yolo",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "train_Dope_i",
|
|||
|
"importPath": "train_Dope",
|
|||
|
"description": "train_Dope",
|
|||
|
"isExtraImport": true,
|
|||
|
"detail": "train_Dope",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "blenderproc",
|
|||
|
"kind": 6,
|
|||
|
"isExtraImport": true,
|
|||
|
"importPath": "blenderproc",
|
|||
|
"description": "blenderproc",
|
|||
|
"detail": "blenderproc",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "numpy",
|
|||
|
"kind": 6,
|
|||
|
"isExtraImport": true,
|
|||
|
"importPath": "numpy",
|
|||
|
"description": "numpy",
|
|||
|
"detail": "numpy",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "random",
|
|||
|
"kind": 6,
|
|||
|
"isExtraImport": true,
|
|||
|
"importPath": "random",
|
|||
|
"description": "random",
|
|||
|
"detail": "random",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "bpy",
|
|||
|
"kind": 6,
|
|||
|
"isExtraImport": true,
|
|||
|
"importPath": "bpy",
|
|||
|
"description": "bpy",
|
|||
|
"detail": "bpy",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "transforms3d",
|
|||
|
"kind": 6,
|
|||
|
"isExtraImport": true,
|
|||
|
"importPath": "transforms3d",
|
|||
|
"description": "transforms3d",
|
|||
|
"detail": "transforms3d",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "yaml",
|
|||
|
"kind": 6,
|
|||
|
"isExtraImport": true,
|
|||
|
"importPath": "yaml",
|
|||
|
"description": "yaml",
|
|||
|
"detail": "yaml",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "YOLO",
|
|||
|
"importPath": "ultralytics",
|
|||
|
"description": "ultralytics",
|
|||
|
"isExtraImport": true,
|
|||
|
"detail": "ultralytics",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "_Known",
|
|||
|
"kind": 6,
|
|||
|
"importPath": "server.node_modules.flatted.python.flatted",
|
|||
|
"description": "server.node_modules.flatted.python.flatted",
|
|||
|
"peekOfCode": "class _Known:\n def __init__(self):\n self.key = []\n self.value = []\nclass _String:\n def __init__(self, value):\n self.value = value\ndef _array_keys(value):\n keys = []\n i = 0",
|
|||
|
"detail": "server.node_modules.flatted.python.flatted",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "_String",
|
|||
|
"kind": 6,
|
|||
|
"importPath": "server.node_modules.flatted.python.flatted",
|
|||
|
"description": "server.node_modules.flatted.python.flatted",
|
|||
|
"peekOfCode": "class _String:\n def __init__(self, value):\n self.value = value\ndef _array_keys(value):\n keys = []\n i = 0\n for _ in value:\n keys.append(i)\n i += 1\n return keys",
|
|||
|
"detail": "server.node_modules.flatted.python.flatted",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "parse",
|
|||
|
"kind": 2,
|
|||
|
"importPath": "server.node_modules.flatted.python.flatted",
|
|||
|
"description": "server.node_modules.flatted.python.flatted",
|
|||
|
"peekOfCode": "def parse(value, *args, **kwargs):\n json = _json.loads(value, *args, **kwargs)\n wrapped = []\n for value in json:\n wrapped.append(_wrap(value))\n input = []\n for value in wrapped:\n if isinstance(value, _String):\n input.append(value.value)\n else:",
|
|||
|
"detail": "server.node_modules.flatted.python.flatted",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "stringify",
|
|||
|
"kind": 2,
|
|||
|
"importPath": "server.node_modules.flatted.python.flatted",
|
|||
|
"description": "server.node_modules.flatted.python.flatted",
|
|||
|
"peekOfCode": "def stringify(value, *args, **kwargs):\n known = _Known()\n input = []\n output = []\n i = int(_index(known, input, value))\n while i < len(input):\n output.append(_transform(known, input, input[i]))\n i += 1\n return _json.dumps(output, *args, **kwargs)",
|
|||
|
"detail": "server.node_modules.flatted.python.flatted",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "stringify",
|
|||
|
"kind": 2,
|
|||
|
"importPath": "server.node_modules.flatted.python.test",
|
|||
|
"description": "server.node_modules.flatted.python.test",
|
|||
|
"peekOfCode": "def stringify(value):\n return _stringify(value, separators=(',', ':'))\nassert stringify([None, None]) == '[[null,null]]'\na = []\no = {}\nassert stringify(a) == '[[]]'\nassert stringify(o) == '[{}]'\na.append(a)\no['o'] = o\nassert stringify(a) == '[[\"0\"]]'",
|
|||
|
"detail": "server.node_modules.flatted.python.test",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "a",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "server.node_modules.flatted.python.test",
|
|||
|
"description": "server.node_modules.flatted.python.test",
|
|||
|
"peekOfCode": "a = []\no = {}\nassert stringify(a) == '[[]]'\nassert stringify(o) == '[{}]'\na.append(a)\no['o'] = o\nassert stringify(a) == '[[\"0\"]]'\nassert stringify(o) == '[{\"o\":\"0\"}]'\nb = parse(stringify(a))\nassert isinstance(b, list) and b[0] == b",
|
|||
|
"detail": "server.node_modules.flatted.python.test",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "o",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "server.node_modules.flatted.python.test",
|
|||
|
"description": "server.node_modules.flatted.python.test",
|
|||
|
"peekOfCode": "o = {}\nassert stringify(a) == '[[]]'\nassert stringify(o) == '[{}]'\na.append(a)\no['o'] = o\nassert stringify(a) == '[[\"0\"]]'\nassert stringify(o) == '[{\"o\":\"0\"}]'\nb = parse(stringify(a))\nassert isinstance(b, list) and b[0] == b\na.append(1)",
|
|||
|
"detail": "server.node_modules.flatted.python.test",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "o['o']",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "server.node_modules.flatted.python.test",
|
|||
|
"description": "server.node_modules.flatted.python.test",
|
|||
|
"peekOfCode": "o['o'] = o\nassert stringify(a) == '[[\"0\"]]'\nassert stringify(o) == '[{\"o\":\"0\"}]'\nb = parse(stringify(a))\nassert isinstance(b, list) and b[0] == b\na.append(1)\na.append('two')\na.append(True)\no['one'] = 1\no['two'] = 'two'",
|
|||
|
"detail": "server.node_modules.flatted.python.test",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "b",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "server.node_modules.flatted.python.test",
|
|||
|
"description": "server.node_modules.flatted.python.test",
|
|||
|
"peekOfCode": "b = parse(stringify(a))\nassert isinstance(b, list) and b[0] == b\na.append(1)\na.append('two')\na.append(True)\no['one'] = 1\no['two'] = 'two'\no['three'] = True\nassert stringify(a) == '[[\"0\",1,\"1\",true],\"two\"]'\nassert stringify(o) == '[{\"o\":\"0\",\"one\":1,\"two\":\"1\",\"three\":true},\"two\"]'",
|
|||
|
"detail": "server.node_modules.flatted.python.test",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "o['one']",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "server.node_modules.flatted.python.test",
|
|||
|
"description": "server.node_modules.flatted.python.test",
|
|||
|
"peekOfCode": "o['one'] = 1\no['two'] = 'two'\no['three'] = True\nassert stringify(a) == '[[\"0\",1,\"1\",true],\"two\"]'\nassert stringify(o) == '[{\"o\":\"0\",\"one\":1,\"two\":\"1\",\"three\":true},\"two\"]'\na.append(o)\no['a'] = a\nassert stringify(a) == '[[\"0\",1,\"1\",true,\"2\"],\"two\",{\"o\":\"2\",\"one\":1,\"two\":\"1\",\"three\":true,\"a\":\"0\"}]'\nassert stringify(o) == '[{\"o\":\"0\",\"one\":1,\"two\":\"1\",\"three\":true,\"a\":\"2\"},\"two\",[\"2\",1,\"1\",true,\"0\"]]'\na.append({'test': 'OK'})",
|
|||
|
"detail": "server.node_modules.flatted.python.test",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "o['two']",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "server.node_modules.flatted.python.test",
|
|||
|
"description": "server.node_modules.flatted.python.test",
|
|||
|
"peekOfCode": "o['two'] = 'two'\no['three'] = True\nassert stringify(a) == '[[\"0\",1,\"1\",true],\"two\"]'\nassert stringify(o) == '[{\"o\":\"0\",\"one\":1,\"two\":\"1\",\"three\":true},\"two\"]'\na.append(o)\no['a'] = a\nassert stringify(a) == '[[\"0\",1,\"1\",true,\"2\"],\"two\",{\"o\":\"2\",\"one\":1,\"two\":\"1\",\"three\":true,\"a\":\"0\"}]'\nassert stringify(o) == '[{\"o\":\"0\",\"one\":1,\"two\":\"1\",\"three\":true,\"a\":\"2\"},\"two\",[\"2\",1,\"1\",true,\"0\"]]'\na.append({'test': 'OK'})\na.append([1, 2, 3])",
|
|||
|
"detail": "server.node_modules.flatted.python.test",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "o['three']",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "server.node_modules.flatted.python.test",
|
|||
|
"description": "server.node_modules.flatted.python.test",
|
|||
|
"peekOfCode": "o['three'] = True\nassert stringify(a) == '[[\"0\",1,\"1\",true],\"two\"]'\nassert stringify(o) == '[{\"o\":\"0\",\"one\":1,\"two\":\"1\",\"three\":true},\"two\"]'\na.append(o)\no['a'] = a\nassert stringify(a) == '[[\"0\",1,\"1\",true,\"2\"],\"two\",{\"o\":\"2\",\"one\":1,\"two\":\"1\",\"three\":true,\"a\":\"0\"}]'\nassert stringify(o) == '[{\"o\":\"0\",\"one\":1,\"two\":\"1\",\"three\":true,\"a\":\"2\"},\"two\",[\"2\",1,\"1\",true,\"0\"]]'\na.append({'test': 'OK'})\na.append([1, 2, 3])\no['test'] = {'test': 'OK'}",
|
|||
|
"detail": "server.node_modules.flatted.python.test",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "o['a']",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "server.node_modules.flatted.python.test",
|
|||
|
"description": "server.node_modules.flatted.python.test",
|
|||
|
"peekOfCode": "o['a'] = a\nassert stringify(a) == '[[\"0\",1,\"1\",true,\"2\"],\"two\",{\"o\":\"2\",\"one\":1,\"two\":\"1\",\"three\":true,\"a\":\"0\"}]'\nassert stringify(o) == '[{\"o\":\"0\",\"one\":1,\"two\":\"1\",\"three\":true,\"a\":\"2\"},\"two\",[\"2\",1,\"1\",true,\"0\"]]'\na.append({'test': 'OK'})\na.append([1, 2, 3])\no['test'] = {'test': 'OK'}\no['array'] = [1, 2, 3]\nassert stringify(a) == '[[\"0\",1,\"1\",true,\"2\",\"3\",\"4\"],\"two\",{\"o\":\"2\",\"one\":1,\"two\":\"1\",\"three\":true,\"a\":\"0\",\"test\":\"3\",\"array\":\"4\"},{\"test\":\"5\"},[1,2,3],\"OK\"]'\nassert stringify(o) == '[{\"o\":\"0\",\"one\":1,\"two\":\"1\",\"three\":true,\"a\":\"2\",\"test\":\"3\",\"array\":\"4\"},\"two\",[\"2\",1,\"1\",true,\"0\",\"3\",\"4\"],{\"test\":\"5\"},[1,2,3],\"OK\"]'\na2 = parse(stringify(a));",
|
|||
|
"detail": "server.node_modules.flatted.python.test",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "o['test']",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "server.node_modules.flatted.python.test",
|
|||
|
"description": "server.node_modules.flatted.python.test",
|
|||
|
"peekOfCode": "o['test'] = {'test': 'OK'}\no['array'] = [1, 2, 3]\nassert stringify(a) == '[[\"0\",1,\"1\",true,\"2\",\"3\",\"4\"],\"two\",{\"o\":\"2\",\"one\":1,\"two\":\"1\",\"three\":true,\"a\":\"0\",\"test\":\"3\",\"array\":\"4\"},{\"test\":\"5\"},[1,2,3],\"OK\"]'\nassert stringify(o) == '[{\"o\":\"0\",\"one\":1,\"two\":\"1\",\"three\":true,\"a\":\"2\",\"test\":\"3\",\"array\":\"4\"},\"two\",[\"2\",1,\"1\",true,\"0\",\"3\",\"4\"],{\"test\":\"5\"},[1,2,3],\"OK\"]'\na2 = parse(stringify(a));\no2 = parse(stringify(o));\nassert a2[0] == a2\nassert o2['o'] == o2\nassert a2[1] == 1 and a2[2] == 'two' and a2[3] == True and isinstance(a2[4], dict)\nassert a2[4] == a2[4]['o'] and a2 == a2[4]['o']['a']",
|
|||
|
"detail": "server.node_modules.flatted.python.test",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "o['array']",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "server.node_modules.flatted.python.test",
|
|||
|
"description": "server.node_modules.flatted.python.test",
|
|||
|
"peekOfCode": "o['array'] = [1, 2, 3]\nassert stringify(a) == '[[\"0\",1,\"1\",true,\"2\",\"3\",\"4\"],\"two\",{\"o\":\"2\",\"one\":1,\"two\":\"1\",\"three\":true,\"a\":\"0\",\"test\":\"3\",\"array\":\"4\"},{\"test\":\"5\"},[1,2,3],\"OK\"]'\nassert stringify(o) == '[{\"o\":\"0\",\"one\":1,\"two\":\"1\",\"three\":true,\"a\":\"2\",\"test\":\"3\",\"array\":\"4\"},\"two\",[\"2\",1,\"1\",true,\"0\",\"3\",\"4\"],{\"test\":\"5\"},[1,2,3],\"OK\"]'\na2 = parse(stringify(a));\no2 = parse(stringify(o));\nassert a2[0] == a2\nassert o2['o'] == o2\nassert a2[1] == 1 and a2[2] == 'two' and a2[3] == True and isinstance(a2[4], dict)\nassert a2[4] == a2[4]['o'] and a2 == a2[4]['o']['a']\nstr = parse('[{\"prop\":\"1\",\"a\":\"2\",\"b\":\"3\"},{\"value\":123},[\"4\",\"5\"],{\"e\":\"6\",\"t\":\"7\",\"p\":4},{},{\"b\":\"8\"},\"f\",{\"a\":\"9\"},[\"10\"],\"sup\",{\"a\":1,\"d\":2,\"c\":\"7\",\"z\":\"11\",\"h\":1},{\"g\":2,\"a\":\"7\",\"b\":\"12\",\"f\":6},{\"r\":4,\"u\":\"7\",\"c\":5}]')",
|
|||
|
"detail": "server.node_modules.flatted.python.test",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "a2",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "server.node_modules.flatted.python.test",
|
|||
|
"description": "server.node_modules.flatted.python.test",
|
|||
|
"peekOfCode": "a2 = parse(stringify(a));\no2 = parse(stringify(o));\nassert a2[0] == a2\nassert o2['o'] == o2\nassert a2[1] == 1 and a2[2] == 'two' and a2[3] == True and isinstance(a2[4], dict)\nassert a2[4] == a2[4]['o'] and a2 == a2[4]['o']['a']\nstr = parse('[{\"prop\":\"1\",\"a\":\"2\",\"b\":\"3\"},{\"value\":123},[\"4\",\"5\"],{\"e\":\"6\",\"t\":\"7\",\"p\":4},{},{\"b\":\"8\"},\"f\",{\"a\":\"9\"},[\"10\"],\"sup\",{\"a\":1,\"d\":2,\"c\":\"7\",\"z\":\"11\",\"h\":1},{\"g\":2,\"a\":\"7\",\"b\":\"12\",\"f\":6},{\"r\":4,\"u\":\"7\",\"c\":5}]')\nassert str['b']['t']['a'] == 'sup' and str['a'][1]['b'][0]['c'] == str['b']['t']\noo = parse('[{\"a\":\"1\",\"b\":\"0\",\"c\":\"2\"},{\"aa\":\"3\"},{\"ca\":\"4\",\"cb\":\"5\",\"cc\":\"6\",\"cd\":\"7\",\"ce\":\"8\",\"cf\":\"9\"},{\"aaa\":\"10\"},{\"caa\":\"4\"},{\"cba\":\"5\"},{\"cca\":\"2\"},{\"cda\":\"4\"},\"value2\",\"value3\",\"value1\"]');\nassert oo['a']['aa']['aaa'] == 'value1' and oo == oo['b'] and oo['c']['ca']['caa'] == oo['c']['ca']",
|
|||
|
"detail": "server.node_modules.flatted.python.test",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "o2",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "server.node_modules.flatted.python.test",
|
|||
|
"description": "server.node_modules.flatted.python.test",
|
|||
|
"peekOfCode": "o2 = parse(stringify(o));\nassert a2[0] == a2\nassert o2['o'] == o2\nassert a2[1] == 1 and a2[2] == 'two' and a2[3] == True and isinstance(a2[4], dict)\nassert a2[4] == a2[4]['o'] and a2 == a2[4]['o']['a']\nstr = parse('[{\"prop\":\"1\",\"a\":\"2\",\"b\":\"3\"},{\"value\":123},[\"4\",\"5\"],{\"e\":\"6\",\"t\":\"7\",\"p\":4},{},{\"b\":\"8\"},\"f\",{\"a\":\"9\"},[\"10\"],\"sup\",{\"a\":1,\"d\":2,\"c\":\"7\",\"z\":\"11\",\"h\":1},{\"g\":2,\"a\":\"7\",\"b\":\"12\",\"f\":6},{\"r\":4,\"u\":\"7\",\"c\":5}]')\nassert str['b']['t']['a'] == 'sup' and str['a'][1]['b'][0]['c'] == str['b']['t']\noo = parse('[{\"a\":\"1\",\"b\":\"0\",\"c\":\"2\"},{\"aa\":\"3\"},{\"ca\":\"4\",\"cb\":\"5\",\"cc\":\"6\",\"cd\":\"7\",\"ce\":\"8\",\"cf\":\"9\"},{\"aaa\":\"10\"},{\"caa\":\"4\"},{\"cba\":\"5\"},{\"cca\":\"2\"},{\"cda\":\"4\"},\"value2\",\"value3\",\"value1\"]');\nassert oo['a']['aa']['aaa'] == 'value1' and oo == oo['b'] and oo['c']['ca']['caa'] == oo['c']['ca']\nprint('OK')",
|
|||
|
"detail": "server.node_modules.flatted.python.test",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "str",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "server.node_modules.flatted.python.test",
|
|||
|
"description": "server.node_modules.flatted.python.test",
|
|||
|
"peekOfCode": "str = parse('[{\"prop\":\"1\",\"a\":\"2\",\"b\":\"3\"},{\"value\":123},[\"4\",\"5\"],{\"e\":\"6\",\"t\":\"7\",\"p\":4},{},{\"b\":\"8\"},\"f\",{\"a\":\"9\"},[\"10\"],\"sup\",{\"a\":1,\"d\":2,\"c\":\"7\",\"z\":\"11\",\"h\":1},{\"g\":2,\"a\":\"7\",\"b\":\"12\",\"f\":6},{\"r\":4,\"u\":\"7\",\"c\":5}]')\nassert str['b']['t']['a'] == 'sup' and str['a'][1]['b'][0]['c'] == str['b']['t']\noo = parse('[{\"a\":\"1\",\"b\":\"0\",\"c\":\"2\"},{\"aa\":\"3\"},{\"ca\":\"4\",\"cb\":\"5\",\"cc\":\"6\",\"cd\":\"7\",\"ce\":\"8\",\"cf\":\"9\"},{\"aaa\":\"10\"},{\"caa\":\"4\"},{\"cba\":\"5\"},{\"cca\":\"2\"},{\"cda\":\"4\"},\"value2\",\"value3\",\"value1\"]');\nassert oo['a']['aa']['aaa'] == 'value1' and oo == oo['b'] and oo['c']['ca']['caa'] == oo['c']['ca']\nprint('OK')",
|
|||
|
"detail": "server.node_modules.flatted.python.test",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "oo",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "server.node_modules.flatted.python.test",
|
|||
|
"description": "server.node_modules.flatted.python.test",
|
|||
|
"peekOfCode": "oo = parse('[{\"a\":\"1\",\"b\":\"0\",\"c\":\"2\"},{\"aa\":\"3\"},{\"ca\":\"4\",\"cb\":\"5\",\"cc\":\"6\",\"cd\":\"7\",\"ce\":\"8\",\"cf\":\"9\"},{\"aaa\":\"10\"},{\"caa\":\"4\"},{\"cba\":\"5\"},{\"cca\":\"2\"},{\"cda\":\"4\"},\"value2\",\"value3\",\"value1\"]');\nassert oo['a']['aa']['aaa'] == 'value1' and oo == oo['b'] and oo['c']['ca']['caa'] == oo['c']['ca']\nprint('OK')",
|
|||
|
"detail": "server.node_modules.flatted.python.test",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "_Known",
|
|||
|
"kind": 6,
|
|||
|
"importPath": "ui.node_modules.flatted.python.flatted",
|
|||
|
"description": "ui.node_modules.flatted.python.flatted",
|
|||
|
"peekOfCode": "class _Known:\n def __init__(self):\n self.key = []\n self.value = []\nclass _String:\n def __init__(self, value):\n self.value = value\ndef _array_keys(value):\n keys = []\n i = 0",
|
|||
|
"detail": "ui.node_modules.flatted.python.flatted",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "_String",
|
|||
|
"kind": 6,
|
|||
|
"importPath": "ui.node_modules.flatted.python.flatted",
|
|||
|
"description": "ui.node_modules.flatted.python.flatted",
|
|||
|
"peekOfCode": "class _String:\n def __init__(self, value):\n self.value = value\ndef _array_keys(value):\n keys = []\n i = 0\n for _ in value:\n keys.append(i)\n i += 1\n return keys",
|
|||
|
"detail": "ui.node_modules.flatted.python.flatted",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "parse",
|
|||
|
"kind": 2,
|
|||
|
"importPath": "ui.node_modules.flatted.python.flatted",
|
|||
|
"description": "ui.node_modules.flatted.python.flatted",
|
|||
|
"peekOfCode": "def parse(value, *args, **kwargs):\n json = _json.loads(value, *args, **kwargs)\n wrapped = []\n for value in json:\n wrapped.append(_wrap(value))\n input = []\n for value in wrapped:\n if isinstance(value, _String):\n input.append(value.value)\n else:",
|
|||
|
"detail": "ui.node_modules.flatted.python.flatted",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "stringify",
|
|||
|
"kind": 2,
|
|||
|
"importPath": "ui.node_modules.flatted.python.flatted",
|
|||
|
"description": "ui.node_modules.flatted.python.flatted",
|
|||
|
"peekOfCode": "def stringify(value, *args, **kwargs):\n known = _Known()\n input = []\n output = []\n i = int(_index(known, input, value))\n while i < len(input):\n output.append(_transform(known, input, input[i]))\n i += 1\n return _json.dumps(output, *args, **kwargs)",
|
|||
|
"detail": "ui.node_modules.flatted.python.flatted",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "stringify",
|
|||
|
"kind": 2,
|
|||
|
"importPath": "ui.node_modules.flatted.python.test",
|
|||
|
"description": "ui.node_modules.flatted.python.test",
|
|||
|
"peekOfCode": "def stringify(value):\n return _stringify(value, separators=(',', ':'))\nassert stringify([None, None]) == '[[null,null]]'\na = []\no = {}\nassert stringify(a) == '[[]]'\nassert stringify(o) == '[{}]'\na.append(a)\no['o'] = o\nassert stringify(a) == '[[\"0\"]]'",
|
|||
|
"detail": "ui.node_modules.flatted.python.test",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "a",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "ui.node_modules.flatted.python.test",
|
|||
|
"description": "ui.node_modules.flatted.python.test",
|
|||
|
"peekOfCode": "a = []\no = {}\nassert stringify(a) == '[[]]'\nassert stringify(o) == '[{}]'\na.append(a)\no['o'] = o\nassert stringify(a) == '[[\"0\"]]'\nassert stringify(o) == '[{\"o\":\"0\"}]'\nb = parse(stringify(a))\nassert isinstance(b, list) and b[0] == b",
|
|||
|
"detail": "ui.node_modules.flatted.python.test",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "o",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "ui.node_modules.flatted.python.test",
|
|||
|
"description": "ui.node_modules.flatted.python.test",
|
|||
|
"peekOfCode": "o = {}\nassert stringify(a) == '[[]]'\nassert stringify(o) == '[{}]'\na.append(a)\no['o'] = o\nassert stringify(a) == '[[\"0\"]]'\nassert stringify(o) == '[{\"o\":\"0\"}]'\nb = parse(stringify(a))\nassert isinstance(b, list) and b[0] == b\na.append(1)",
|
|||
|
"detail": "ui.node_modules.flatted.python.test",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "o['o']",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "ui.node_modules.flatted.python.test",
|
|||
|
"description": "ui.node_modules.flatted.python.test",
|
|||
|
"peekOfCode": "o['o'] = o\nassert stringify(a) == '[[\"0\"]]'\nassert stringify(o) == '[{\"o\":\"0\"}]'\nb = parse(stringify(a))\nassert isinstance(b, list) and b[0] == b\na.append(1)\na.append('two')\na.append(True)\no['one'] = 1\no['two'] = 'two'",
|
|||
|
"detail": "ui.node_modules.flatted.python.test",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "b",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "ui.node_modules.flatted.python.test",
|
|||
|
"description": "ui.node_modules.flatted.python.test",
|
|||
|
"peekOfCode": "b = parse(stringify(a))\nassert isinstance(b, list) and b[0] == b\na.append(1)\na.append('two')\na.append(True)\no['one'] = 1\no['two'] = 'two'\no['three'] = True\nassert stringify(a) == '[[\"0\",1,\"1\",true],\"two\"]'\nassert stringify(o) == '[{\"o\":\"0\",\"one\":1,\"two\":\"1\",\"three\":true},\"two\"]'",
|
|||
|
"detail": "ui.node_modules.flatted.python.test",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "o['one']",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "ui.node_modules.flatted.python.test",
|
|||
|
"description": "ui.node_modules.flatted.python.test",
|
|||
|
"peekOfCode": "o['one'] = 1\no['two'] = 'two'\no['three'] = True\nassert stringify(a) == '[[\"0\",1,\"1\",true],\"two\"]'\nassert stringify(o) == '[{\"o\":\"0\",\"one\":1,\"two\":\"1\",\"three\":true},\"two\"]'\na.append(o)\no['a'] = a\nassert stringify(a) == '[[\"0\",1,\"1\",true,\"2\"],\"two\",{\"o\":\"2\",\"one\":1,\"two\":\"1\",\"three\":true,\"a\":\"0\"}]'\nassert stringify(o) == '[{\"o\":\"0\",\"one\":1,\"two\":\"1\",\"three\":true,\"a\":\"2\"},\"two\",[\"2\",1,\"1\",true,\"0\"]]'\na.append({'test': 'OK'})",
|
|||
|
"detail": "ui.node_modules.flatted.python.test",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "o['two']",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "ui.node_modules.flatted.python.test",
|
|||
|
"description": "ui.node_modules.flatted.python.test",
|
|||
|
"peekOfCode": "o['two'] = 'two'\no['three'] = True\nassert stringify(a) == '[[\"0\",1,\"1\",true],\"two\"]'\nassert stringify(o) == '[{\"o\":\"0\",\"one\":1,\"two\":\"1\",\"three\":true},\"two\"]'\na.append(o)\no['a'] = a\nassert stringify(a) == '[[\"0\",1,\"1\",true,\"2\"],\"two\",{\"o\":\"2\",\"one\":1,\"two\":\"1\",\"three\":true,\"a\":\"0\"}]'\nassert stringify(o) == '[{\"o\":\"0\",\"one\":1,\"two\":\"1\",\"three\":true,\"a\":\"2\"},\"two\",[\"2\",1,\"1\",true,\"0\"]]'\na.append({'test': 'OK'})\na.append([1, 2, 3])",
|
|||
|
"detail": "ui.node_modules.flatted.python.test",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "o['three']",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "ui.node_modules.flatted.python.test",
|
|||
|
"description": "ui.node_modules.flatted.python.test",
|
|||
|
"peekOfCode": "o['three'] = True\nassert stringify(a) == '[[\"0\",1,\"1\",true],\"two\"]'\nassert stringify(o) == '[{\"o\":\"0\",\"one\":1,\"two\":\"1\",\"three\":true},\"two\"]'\na.append(o)\no['a'] = a\nassert stringify(a) == '[[\"0\",1,\"1\",true,\"2\"],\"two\",{\"o\":\"2\",\"one\":1,\"two\":\"1\",\"three\":true,\"a\":\"0\"}]'\nassert stringify(o) == '[{\"o\":\"0\",\"one\":1,\"two\":\"1\",\"three\":true,\"a\":\"2\"},\"two\",[\"2\",1,\"1\",true,\"0\"]]'\na.append({'test': 'OK'})\na.append([1, 2, 3])\no['test'] = {'test': 'OK'}",
|
|||
|
"detail": "ui.node_modules.flatted.python.test",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "o['a']",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "ui.node_modules.flatted.python.test",
|
|||
|
"description": "ui.node_modules.flatted.python.test",
|
|||
|
"peekOfCode": "o['a'] = a\nassert stringify(a) == '[[\"0\",1,\"1\",true,\"2\"],\"two\",{\"o\":\"2\",\"one\":1,\"two\":\"1\",\"three\":true,\"a\":\"0\"}]'\nassert stringify(o) == '[{\"o\":\"0\",\"one\":1,\"two\":\"1\",\"three\":true,\"a\":\"2\"},\"two\",[\"2\",1,\"1\",true,\"0\"]]'\na.append({'test': 'OK'})\na.append([1, 2, 3])\no['test'] = {'test': 'OK'}\no['array'] = [1, 2, 3]\nassert stringify(a) == '[[\"0\",1,\"1\",true,\"2\",\"3\",\"4\"],\"two\",{\"o\":\"2\",\"one\":1,\"two\":\"1\",\"three\":true,\"a\":\"0\",\"test\":\"3\",\"array\":\"4\"},{\"test\":\"5\"},[1,2,3],\"OK\"]'\nassert stringify(o) == '[{\"o\":\"0\",\"one\":1,\"two\":\"1\",\"three\":true,\"a\":\"2\",\"test\":\"3\",\"array\":\"4\"},\"two\",[\"2\",1,\"1\",true,\"0\",\"3\",\"4\"],{\"test\":\"5\"},[1,2,3],\"OK\"]'\na2 = parse(stringify(a));",
|
|||
|
"detail": "ui.node_modules.flatted.python.test",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "o['test']",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "ui.node_modules.flatted.python.test",
|
|||
|
"description": "ui.node_modules.flatted.python.test",
|
|||
|
"peekOfCode": "o['test'] = {'test': 'OK'}\no['array'] = [1, 2, 3]\nassert stringify(a) == '[[\"0\",1,\"1\",true,\"2\",\"3\",\"4\"],\"two\",{\"o\":\"2\",\"one\":1,\"two\":\"1\",\"three\":true,\"a\":\"0\",\"test\":\"3\",\"array\":\"4\"},{\"test\":\"5\"},[1,2,3],\"OK\"]'\nassert stringify(o) == '[{\"o\":\"0\",\"one\":1,\"two\":\"1\",\"three\":true,\"a\":\"2\",\"test\":\"3\",\"array\":\"4\"},\"two\",[\"2\",1,\"1\",true,\"0\",\"3\",\"4\"],{\"test\":\"5\"},[1,2,3],\"OK\"]'\na2 = parse(stringify(a));\no2 = parse(stringify(o));\nassert a2[0] == a2\nassert o2['o'] == o2\nassert a2[1] == 1 and a2[2] == 'two' and a2[3] == True and isinstance(a2[4], dict)\nassert a2[4] == a2[4]['o'] and a2 == a2[4]['o']['a']",
|
|||
|
"detail": "ui.node_modules.flatted.python.test",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "o['array']",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "ui.node_modules.flatted.python.test",
|
|||
|
"description": "ui.node_modules.flatted.python.test",
|
|||
|
"peekOfCode": "o['array'] = [1, 2, 3]\nassert stringify(a) == '[[\"0\",1,\"1\",true,\"2\",\"3\",\"4\"],\"two\",{\"o\":\"2\",\"one\":1,\"two\":\"1\",\"three\":true,\"a\":\"0\",\"test\":\"3\",\"array\":\"4\"},{\"test\":\"5\"},[1,2,3],\"OK\"]'\nassert stringify(o) == '[{\"o\":\"0\",\"one\":1,\"two\":\"1\",\"three\":true,\"a\":\"2\",\"test\":\"3\",\"array\":\"4\"},\"two\",[\"2\",1,\"1\",true,\"0\",\"3\",\"4\"],{\"test\":\"5\"},[1,2,3],\"OK\"]'\na2 = parse(stringify(a));\no2 = parse(stringify(o));\nassert a2[0] == a2\nassert o2['o'] == o2\nassert a2[1] == 1 and a2[2] == 'two' and a2[3] == True and isinstance(a2[4], dict)\nassert a2[4] == a2[4]['o'] and a2 == a2[4]['o']['a']\nstr = parse('[{\"prop\":\"1\",\"a\":\"2\",\"b\":\"3\"},{\"value\":123},[\"4\",\"5\"],{\"e\":\"6\",\"t\":\"7\",\"p\":4},{},{\"b\":\"8\"},\"f\",{\"a\":\"9\"},[\"10\"],\"sup\",{\"a\":1,\"d\":2,\"c\":\"7\",\"z\":\"11\",\"h\":1},{\"g\":2,\"a\":\"7\",\"b\":\"12\",\"f\":6},{\"r\":4,\"u\":\"7\",\"c\":5}]')",
|
|||
|
"detail": "ui.node_modules.flatted.python.test",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "a2",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "ui.node_modules.flatted.python.test",
|
|||
|
"description": "ui.node_modules.flatted.python.test",
|
|||
|
"peekOfCode": "a2 = parse(stringify(a));\no2 = parse(stringify(o));\nassert a2[0] == a2\nassert o2['o'] == o2\nassert a2[1] == 1 and a2[2] == 'two' and a2[3] == True and isinstance(a2[4], dict)\nassert a2[4] == a2[4]['o'] and a2 == a2[4]['o']['a']\nstr = parse('[{\"prop\":\"1\",\"a\":\"2\",\"b\":\"3\"},{\"value\":123},[\"4\",\"5\"],{\"e\":\"6\",\"t\":\"7\",\"p\":4},{},{\"b\":\"8\"},\"f\",{\"a\":\"9\"},[\"10\"],\"sup\",{\"a\":1,\"d\":2,\"c\":\"7\",\"z\":\"11\",\"h\":1},{\"g\":2,\"a\":\"7\",\"b\":\"12\",\"f\":6},{\"r\":4,\"u\":\"7\",\"c\":5}]')\nassert str['b']['t']['a'] == 'sup' and str['a'][1]['b'][0]['c'] == str['b']['t']\noo = parse('[{\"a\":\"1\",\"b\":\"0\",\"c\":\"2\"},{\"aa\":\"3\"},{\"ca\":\"4\",\"cb\":\"5\",\"cc\":\"6\",\"cd\":\"7\",\"ce\":\"8\",\"cf\":\"9\"},{\"aaa\":\"10\"},{\"caa\":\"4\"},{\"cba\":\"5\"},{\"cca\":\"2\"},{\"cda\":\"4\"},\"value2\",\"value3\",\"value1\"]');\nassert oo['a']['aa']['aaa'] == 'value1' and oo == oo['b'] and oo['c']['ca']['caa'] == oo['c']['ca']",
|
|||
|
"detail": "ui.node_modules.flatted.python.test",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "o2",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "ui.node_modules.flatted.python.test",
|
|||
|
"description": "ui.node_modules.flatted.python.test",
|
|||
|
"peekOfCode": "o2 = parse(stringify(o));\nassert a2[0] == a2\nassert o2['o'] == o2\nassert a2[1] == 1 and a2[2] == 'two' and a2[3] == True and isinstance(a2[4], dict)\nassert a2[4] == a2[4]['o'] and a2 == a2[4]['o']['a']\nstr = parse('[{\"prop\":\"1\",\"a\":\"2\",\"b\":\"3\"},{\"value\":123},[\"4\",\"5\"],{\"e\":\"6\",\"t\":\"7\",\"p\":4},{},{\"b\":\"8\"},\"f\",{\"a\":\"9\"},[\"10\"],\"sup\",{\"a\":1,\"d\":2,\"c\":\"7\",\"z\":\"11\",\"h\":1},{\"g\":2,\"a\":\"7\",\"b\":\"12\",\"f\":6},{\"r\":4,\"u\":\"7\",\"c\":5}]')\nassert str['b']['t']['a'] == 'sup' and str['a'][1]['b'][0]['c'] == str['b']['t']\noo = parse('[{\"a\":\"1\",\"b\":\"0\",\"c\":\"2\"},{\"aa\":\"3\"},{\"ca\":\"4\",\"cb\":\"5\",\"cc\":\"6\",\"cd\":\"7\",\"ce\":\"8\",\"cf\":\"9\"},{\"aaa\":\"10\"},{\"caa\":\"4\"},{\"cba\":\"5\"},{\"cca\":\"2\"},{\"cda\":\"4\"},\"value2\",\"value3\",\"value1\"]');\nassert oo['a']['aa']['aaa'] == 'value1' and oo == oo['b'] and oo['c']['ca']['caa'] == oo['c']['ca']\nprint('OK')",
|
|||
|
"detail": "ui.node_modules.flatted.python.test",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "str",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "ui.node_modules.flatted.python.test",
|
|||
|
"description": "ui.node_modules.flatted.python.test",
|
|||
|
"peekOfCode": "str = parse('[{\"prop\":\"1\",\"a\":\"2\",\"b\":\"3\"},{\"value\":123},[\"4\",\"5\"],{\"e\":\"6\",\"t\":\"7\",\"p\":4},{},{\"b\":\"8\"},\"f\",{\"a\":\"9\"},[\"10\"],\"sup\",{\"a\":1,\"d\":2,\"c\":\"7\",\"z\":\"11\",\"h\":1},{\"g\":2,\"a\":\"7\",\"b\":\"12\",\"f\":6},{\"r\":4,\"u\":\"7\",\"c\":5}]')\nassert str['b']['t']['a'] == 'sup' and str['a'][1]['b'][0]['c'] == str['b']['t']\noo = parse('[{\"a\":\"1\",\"b\":\"0\",\"c\":\"2\"},{\"aa\":\"3\"},{\"ca\":\"4\",\"cb\":\"5\",\"cc\":\"6\",\"cd\":\"7\",\"ce\":\"8\",\"cf\":\"9\"},{\"aaa\":\"10\"},{\"caa\":\"4\"},{\"cba\":\"5\"},{\"cca\":\"2\"},{\"cda\":\"4\"},\"value2\",\"value3\",\"value1\"]');\nassert oo['a']['aa']['aaa'] == 'value1' and oo == oo['b'] and oo['c']['ca']['caa'] == oo['c']['ca']\nprint('OK')",
|
|||
|
"detail": "ui.node_modules.flatted.python.test",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "oo",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "ui.node_modules.flatted.python.test",
|
|||
|
"description": "ui.node_modules.flatted.python.test",
|
|||
|
"peekOfCode": "oo = parse('[{\"a\":\"1\",\"b\":\"0\",\"c\":\"2\"},{\"aa\":\"3\"},{\"ca\":\"4\",\"cb\":\"5\",\"cc\":\"6\",\"cd\":\"7\",\"ce\":\"8\",\"cf\":\"9\"},{\"aaa\":\"10\"},{\"caa\":\"4\"},{\"cba\":\"5\"},{\"cca\":\"2\"},{\"cda\":\"4\"},\"value2\",\"value3\",\"value1\"]');\nassert oo['a']['aa']['aaa'] == 'value1' and oo == oo['b'] and oo['c']['ca']['caa'] == oo['c']['ca']\nprint('OK')",
|
|||
|
"detail": "ui.node_modules.flatted.python.test",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "get_script_args",
|
|||
|
"kind": 2,
|
|||
|
"importPath": "web_p.GetInterfaces.get_interfaces",
|
|||
|
"description": "web_p.GetInterfaces.get_interfaces",
|
|||
|
"peekOfCode": "def get_script_args(cfg):\n args = cfg[\"command\"].split()\n args.append(cfg[\"package\"])\n args.append(cfg[\"executable\"])\n return args\ndef get_topics(filename, path):\n jsonpath = os.path.join(path, filename)\n with NodeStrategy({}) as node:\n topic_names_and_types = get_topic_names_and_types(node=node, include_hidden_topics=False)\n topic_info = []",
|
|||
|
"detail": "web_p.GetInterfaces.get_interfaces",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "get_topics",
|
|||
|
"kind": 2,
|
|||
|
"importPath": "web_p.GetInterfaces.get_interfaces",
|
|||
|
"description": "web_p.GetInterfaces.get_interfaces",
|
|||
|
"peekOfCode": "def get_topics(filename, path):\n jsonpath = os.path.join(path, filename)\n with NodeStrategy({}) as node:\n topic_names_and_types = get_topic_names_and_types(node=node, include_hidden_topics=False)\n topic_info = []\n for (topic_name, topic_types) in topic_names_and_types:\n if not topic_name in TOPICS_FILTER:\n topic_info.append({\"name\": topic_name, \"type\": topic_types[0]})\n print(f\"---> number of topics: {len(topic_info)}\")\n j_data = {\"topics\": topic_info}",
|
|||
|
"detail": "web_p.GetInterfaces.get_interfaces",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "OUTPUT_FILE",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.GetInterfaces.get_interfaces",
|
|||
|
"description": "web_p.GetInterfaces.get_interfaces",
|
|||
|
"peekOfCode": "OUTPUT_FILE = \"topics.json\"\nTOPICS_FILTER = [\"/parameter_events\", \"/rosout\"]\ndef get_script_args(cfg):\n args = cfg[\"command\"].split()\n args.append(cfg[\"package\"])\n args.append(cfg[\"executable\"])\n return args\ndef get_topics(filename, path):\n jsonpath = os.path.join(path, filename)\n with NodeStrategy({}) as node:",
|
|||
|
"detail": "web_p.GetInterfaces.get_interfaces",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "TOPICS_FILTER",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.GetInterfaces.get_interfaces",
|
|||
|
"description": "web_p.GetInterfaces.get_interfaces",
|
|||
|
"peekOfCode": "TOPICS_FILTER = [\"/parameter_events\", \"/rosout\"]\ndef get_script_args(cfg):\n args = cfg[\"command\"].split()\n args.append(cfg[\"package\"])\n args.append(cfg[\"executable\"])\n return args\ndef get_topics(filename, path):\n jsonpath = os.path.join(path, filename)\n with NodeStrategy({}) as node:\n topic_names_and_types = get_topic_names_and_types(node=node, include_hidden_topics=False)",
|
|||
|
"detail": "web_p.GetInterfaces.get_interfaces",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "copy_and_move_folder",
|
|||
|
"kind": 2,
|
|||
|
"importPath": "web_p.blender",
|
|||
|
"description": "web_p.blender",
|
|||
|
"peekOfCode": "def copy_and_move_folder(src, dst):\n try:\n if os.path.exists(dst):\n shutil.rmtree(dst)\n shutil.copytree(src, dst)\n print(f\"Folder {src} successfully copied\")\n except shutil.Error as e:\n print(f\"Error: {e}\")\nsource_folder = os.path.dirname(os.path.abspath(__file__)) + \"/blender/\"\ncopy_and_move_folder(source_folder, args.path)",
|
|||
|
"detail": "web_p.blender",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "parser",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.blender",
|
|||
|
"description": "web_p.blender",
|
|||
|
"peekOfCode": "parser = argparse.ArgumentParser()\nparser.add_argument(\"--path\")\nargs = parser.parse_args()\ndef copy_and_move_folder(src, dst):\n try:\n if os.path.exists(dst):\n shutil.rmtree(dst)\n shutil.copytree(src, dst)\n print(f\"Folder {src} successfully copied\")\n except shutil.Error as e:",
|
|||
|
"detail": "web_p.blender",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "args",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.blender",
|
|||
|
"description": "web_p.blender",
|
|||
|
"peekOfCode": "args = parser.parse_args()\ndef copy_and_move_folder(src, dst):\n try:\n if os.path.exists(dst):\n shutil.rmtree(dst)\n shutil.copytree(src, dst)\n print(f\"Folder {src} successfully copied\")\n except shutil.Error as e:\n print(f\"Error: {e}\")\nsource_folder = os.path.dirname(os.path.abspath(__file__)) + \"/blender/\"",
|
|||
|
"detail": "web_p.blender",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "source_folder",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.blender",
|
|||
|
"description": "web_p.blender",
|
|||
|
"peekOfCode": "source_folder = os.path.dirname(os.path.abspath(__file__)) + \"/blender/\"\ncopy_and_move_folder(source_folder, args.path)",
|
|||
|
"detail": "web_p.blender",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "copy_and_move_folder",
|
|||
|
"kind": 2,
|
|||
|
"importPath": "web_p.education",
|
|||
|
"description": "web_p.education",
|
|||
|
"peekOfCode": "def copy_and_move_folder(src, dst, folder):\n try:\n if os.path.exists(dst + \"/education/\") is False:\n Path(dst + \"/education/\").mkdir(parents=True, exist_ok=True)\n if os.path.exists(dst + \"/education/\" + folder + \"/\"):\n shutil.rmtree(dst + \"/education/\" + folder + \"/\")\n shutil.copytree(src, dst + \"/education/\" + folder + \"/\")\n except shutil.Error as e:\n print(f\"Error: {e}\")\nsource_folder = os.path.dirname(os.path.abspath(__file__)) + \"/education\"",
|
|||
|
"detail": "web_p.education",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "parser",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.education",
|
|||
|
"description": "web_p.education",
|
|||
|
"peekOfCode": "parser = argparse.ArgumentParser()\nparser.add_argument(\"--path\", required=True, help=\"Path for dataset\")\nparser.add_argument(\"--name\", required=True, help=\"String with result weights name\")\nparser.add_argument(\"--datasetName\", required=True, help=\"String with dataset name\")\nparser.add_argument(\"--outpath\", default=\"weights\", help=\"Output path for weights\")\nparser.add_argument(\"--type\", default=\"ObjectDetection\", help=\"Type of implementation\")\nparser.add_argument(\"--epoch\", default=3, help=\"How many training epochs\")\nparser.add_argument('--pretrain', help=\"Use pretraining\")\nargs = parser.parse_args()\ndef copy_and_move_folder(src, dst, folder):",
|
|||
|
"detail": "web_p.education",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "args",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.education",
|
|||
|
"description": "web_p.education",
|
|||
|
"peekOfCode": "args = parser.parse_args()\ndef copy_and_move_folder(src, dst, folder):\n try:\n if os.path.exists(dst + \"/education/\") is False:\n Path(dst + \"/education/\").mkdir(parents=True, exist_ok=True)\n if os.path.exists(dst + \"/education/\" + folder + \"/\"):\n shutil.rmtree(dst + \"/education/\" + folder + \"/\")\n shutil.copytree(src, dst + \"/education/\" + folder + \"/\")\n except shutil.Error as e:\n print(f\"Error: {e}\")",
|
|||
|
"detail": "web_p.education",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "source_folder",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.education",
|
|||
|
"description": "web_p.education",
|
|||
|
"peekOfCode": "source_folder = os.path.dirname(os.path.abspath(__file__)) + \"/education\"\ncopy_and_move_folder(source_folder, args.path, args.name)",
|
|||
|
"detail": "web_p.education",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "copy_and_move_folder",
|
|||
|
"kind": 2,
|
|||
|
"importPath": "web_p.get_interfaces_mock",
|
|||
|
"description": "web_p.get_interfaces_mock",
|
|||
|
"peekOfCode": "def copy_and_move_folder(src, dst):\n try:\n if os.path.exists(dst):\n shutil.rmtree(dst)\n shutil.copytree(src, dst)\n print(f\"Folder {src} successfully copied\")\n except shutil.Error as e:\n print(f\"Error: {e}\")\nsource_folder = os.path.dirname(os.path.abspath(__file__)) + \"/interfaces/\"\ncopy_and_move_folder(source_folder, args.path)",
|
|||
|
"detail": "web_p.get_interfaces_mock",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "parser",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.get_interfaces_mock",
|
|||
|
"description": "web_p.get_interfaces_mock",
|
|||
|
"peekOfCode": "parser = argparse.ArgumentParser()\nparser.add_argument(\"--path\")\nargs = parser.parse_args()\ndef copy_and_move_folder(src, dst):\n try:\n if os.path.exists(dst):\n shutil.rmtree(dst)\n shutil.copytree(src, dst)\n print(f\"Folder {src} successfully copied\")\n except shutil.Error as e:",
|
|||
|
"detail": "web_p.get_interfaces_mock",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "args",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.get_interfaces_mock",
|
|||
|
"description": "web_p.get_interfaces_mock",
|
|||
|
"peekOfCode": "args = parser.parse_args()\ndef copy_and_move_folder(src, dst):\n try:\n if os.path.exists(dst):\n shutil.rmtree(dst)\n shutil.copytree(src, dst)\n print(f\"Folder {src} successfully copied\")\n except shutil.Error as e:\n print(f\"Error: {e}\")\nsource_folder = os.path.dirname(os.path.abspath(__file__)) + \"/interfaces/\"",
|
|||
|
"detail": "web_p.get_interfaces_mock",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "source_folder",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.get_interfaces_mock",
|
|||
|
"description": "web_p.get_interfaces_mock",
|
|||
|
"peekOfCode": "source_folder = os.path.dirname(os.path.abspath(__file__)) + \"/interfaces/\"\ncopy_and_move_folder(source_folder, args.path)",
|
|||
|
"detail": "web_p.get_interfaces_mock",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "convert2relative",
|
|||
|
"kind": 2,
|
|||
|
"importPath": "web_p.renderBOPdataset",
|
|||
|
"description": "web_p.renderBOPdataset",
|
|||
|
"peekOfCode": "def convert2relative(height, width, bbox):\n \"\"\"\n YOLO format use relative coordinates for annotation\n \"\"\"\n x, y, w, h = bbox\n x += w/2\n y += h/2\n return x/width, y/height, w/width, h/height\ndef render() -> int:\n i = 0",
|
|||
|
"detail": "web_p.renderBOPdataset",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "render",
|
|||
|
"kind": 2,
|
|||
|
"importPath": "web_p.renderBOPdataset",
|
|||
|
"description": "web_p.renderBOPdataset",
|
|||
|
"peekOfCode": "def render() -> int:\n i = 0\n for obj in all_meshs:\n # Make the object actively participate in the physics simulation\n obj.enable_rigidbody(active=True, collision_shape=\"COMPOUND\")\n # Also use convex decomposition as collision shapes\n obj.build_convex_decomposition_collision_shape(VHACD_PATH)\n i += 1\n # print(f\"{i} : {obj.get_name()}\")\n objs = all_meshs + rnd_par.scene.objs",
|
|||
|
"detail": "web_p.renderBOPdataset",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "VHACD_PATH",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.renderBOPdataset",
|
|||
|
"description": "web_p.renderBOPdataset",
|
|||
|
"peekOfCode": "VHACD_PATH = \"blenderproc_resources/vhacd\"\nDIR_MODELS = \"models\"\nDIR_MESH = \"assets/libs/objects/\" #\"assets/mesh/\"\nFILE_LOG_SCENE = \"res.txt\"\nFILE_RBS_INFO = \"rbs_info.json\"\nFILE_GT_COCO = \"scene_gt_coco.json\"\nEXT_MODELS = \".fbx\"\nTEXTURE_TMPL = \"*.jpg\"\nNot_Categories_Name = True # наименование категории в COCO-аннотации отсутствует\ndef _get_list_texture(rel_path: str) -> list:",
|
|||
|
"detail": "web_p.renderBOPdataset",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "DIR_MODELS",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.renderBOPdataset",
|
|||
|
"description": "web_p.renderBOPdataset",
|
|||
|
"peekOfCode": "DIR_MODELS = \"models\"\nDIR_MESH = \"assets/libs/objects/\" #\"assets/mesh/\"\nFILE_LOG_SCENE = \"res.txt\"\nFILE_RBS_INFO = \"rbs_info.json\"\nFILE_GT_COCO = \"scene_gt_coco.json\"\nEXT_MODELS = \".fbx\"\nTEXTURE_TMPL = \"*.jpg\"\nNot_Categories_Name = True # наименование категории в COCO-аннотации отсутствует\ndef _get_list_texture(rel_path: str) -> list:\n # local_path/texture/",
|
|||
|
"detail": "web_p.renderBOPdataset",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "DIR_MESH",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.renderBOPdataset",
|
|||
|
"description": "web_p.renderBOPdataset",
|
|||
|
"peekOfCode": "DIR_MESH = \"assets/libs/objects/\" #\"assets/mesh/\"\nFILE_LOG_SCENE = \"res.txt\"\nFILE_RBS_INFO = \"rbs_info.json\"\nFILE_GT_COCO = \"scene_gt_coco.json\"\nEXT_MODELS = \".fbx\"\nTEXTURE_TMPL = \"*.jpg\"\nNot_Categories_Name = True # наименование категории в COCO-аннотации отсутствует\ndef _get_list_texture(rel_path: str) -> list:\n # local_path/texture/\n loc = os.path.dirname(os.path.dirname(rnd_par.output_dir))",
|
|||
|
"detail": "web_p.renderBOPdataset",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "FILE_LOG_SCENE",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.renderBOPdataset",
|
|||
|
"description": "web_p.renderBOPdataset",
|
|||
|
"peekOfCode": "FILE_LOG_SCENE = \"res.txt\"\nFILE_RBS_INFO = \"rbs_info.json\"\nFILE_GT_COCO = \"scene_gt_coco.json\"\nEXT_MODELS = \".fbx\"\nTEXTURE_TMPL = \"*.jpg\"\nNot_Categories_Name = True # наименование категории в COCO-аннотации отсутствует\ndef _get_list_texture(rel_path: str) -> list:\n # local_path/texture/\n loc = os.path.dirname(os.path.dirname(rnd_par.output_dir))\n path = os.path.join(loc, rel_path)",
|
|||
|
"detail": "web_p.renderBOPdataset",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "FILE_RBS_INFO",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.renderBOPdataset",
|
|||
|
"description": "web_p.renderBOPdataset",
|
|||
|
"peekOfCode": "FILE_RBS_INFO = \"rbs_info.json\"\nFILE_GT_COCO = \"scene_gt_coco.json\"\nEXT_MODELS = \".fbx\"\nTEXTURE_TMPL = \"*.jpg\"\nNot_Categories_Name = True # наименование категории в COCO-аннотации отсутствует\ndef _get_list_texture(rel_path: str) -> list:\n # local_path/texture/\n loc = os.path.dirname(os.path.dirname(rnd_par.output_dir))\n path = os.path.join(loc, rel_path)\n return list(Path(path).absolute().rglob(TEXTURE_TMPL))",
|
|||
|
"detail": "web_p.renderBOPdataset",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "FILE_GT_COCO",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.renderBOPdataset",
|
|||
|
"description": "web_p.renderBOPdataset",
|
|||
|
"peekOfCode": "FILE_GT_COCO = \"scene_gt_coco.json\"\nEXT_MODELS = \".fbx\"\nTEXTURE_TMPL = \"*.jpg\"\nNot_Categories_Name = True # наименование категории в COCO-аннотации отсутствует\ndef _get_list_texture(rel_path: str) -> list:\n # local_path/texture/\n loc = os.path.dirname(os.path.dirname(rnd_par.output_dir))\n path = os.path.join(loc, rel_path)\n return list(Path(path).absolute().rglob(TEXTURE_TMPL))\ndef _get_path_model(name_model: str) -> str:",
|
|||
|
"detail": "web_p.renderBOPdataset",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "EXT_MODELS",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.renderBOPdataset",
|
|||
|
"description": "web_p.renderBOPdataset",
|
|||
|
"peekOfCode": "EXT_MODELS = \".fbx\"\nTEXTURE_TMPL = \"*.jpg\"\nNot_Categories_Name = True # наименование категории в COCO-аннотации отсутствует\ndef _get_list_texture(rel_path: str) -> list:\n # local_path/texture/\n loc = os.path.dirname(os.path.dirname(rnd_par.output_dir))\n path = os.path.join(loc, rel_path)\n return list(Path(path).absolute().rglob(TEXTURE_TMPL))\ndef _get_path_model(name_model: str) -> str:\n # TODO on name_model find path for mesh (model.fbx)",
|
|||
|
"detail": "web_p.renderBOPdataset",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "TEXTURE_TMPL",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.renderBOPdataset",
|
|||
|
"description": "web_p.renderBOPdataset",
|
|||
|
"peekOfCode": "TEXTURE_TMPL = \"*.jpg\"\nNot_Categories_Name = True # наименование категории в COCO-аннотации отсутствует\ndef _get_list_texture(rel_path: str) -> list:\n # local_path/texture/\n loc = os.path.dirname(os.path.dirname(rnd_par.output_dir))\n path = os.path.join(loc, rel_path)\n return list(Path(path).absolute().rglob(TEXTURE_TMPL))\ndef _get_path_model(name_model: str) -> str:\n # TODO on name_model find path for mesh (model.fbx)\n # local_path/assets/libs/objects # assets/mesh/",
|
|||
|
"detail": "web_p.renderBOPdataset",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "Not_Categories_Name",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.renderBOPdataset",
|
|||
|
"description": "web_p.renderBOPdataset",
|
|||
|
"peekOfCode": "Not_Categories_Name = True # наименование категории в COCO-аннотации отсутствует\ndef _get_list_texture(rel_path: str) -> list:\n # local_path/texture/\n loc = os.path.dirname(os.path.dirname(rnd_par.output_dir))\n path = os.path.join(loc, rel_path)\n return list(Path(path).absolute().rglob(TEXTURE_TMPL))\ndef _get_path_model(name_model: str) -> str:\n # TODO on name_model find path for mesh (model.fbx)\n # local_path/assets/libs/objects # assets/mesh/\n loc = os.path.dirname(os.path.dirname(rnd_par.output_dir))",
|
|||
|
"detail": "web_p.renderBOPdataset",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "convert2relative",
|
|||
|
"kind": 2,
|
|||
|
"importPath": "web_p.renderBOPdataset2",
|
|||
|
"description": "web_p.renderBOPdataset2",
|
|||
|
"peekOfCode": "def convert2relative(height, width, bbox):\n \"\"\"\n YOLO format use relative coordinates for annotation\n \"\"\"\n x, y, w, h = bbox\n x += w/2\n y += h/2\n return x/width, y/height, w/width, h/height\ndef render() -> int:\n i = 0",
|
|||
|
"detail": "web_p.renderBOPdataset2",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "render",
|
|||
|
"kind": 2,
|
|||
|
"importPath": "web_p.renderBOPdataset2",
|
|||
|
"description": "web_p.renderBOPdataset2",
|
|||
|
"peekOfCode": "def render() -> int:\n i = 0\n for obj in all_meshs:\n # Make the object actively participate in the physics simulation\n obj.enable_rigidbody(active=True, collision_shape=\"COMPOUND\")\n # Also use convex decomposition as collision shapes\n obj.build_convex_decomposition_collision_shape(VHACD_PATH)\n i += 1\n # print(f\"{i} : {obj.get_name()}\")\n objs = all_meshs + rnd_par.scene.objs",
|
|||
|
"detail": "web_p.renderBOPdataset2",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "VHACD_PATH",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.renderBOPdataset2",
|
|||
|
"description": "web_p.renderBOPdataset2",
|
|||
|
"peekOfCode": "VHACD_PATH = \"blenderproc_resources/vhacd\"\nDIR_MODELS = \"models\"\nDIR_MESH = \"assets/libs/objects/\"\nFILE_LOG_SCENE = \"res.txt\"\nFILE_RBS_INFO = \"rbs_info.json\"\nFILE_GT_COCO = \"scene_gt_coco.json\"\nEXT_MODELS = \".fbx\"\nTEXTURE_TMPL = \"*.jpg\"\nNot_Categories_Name = True # наименование категории в COCO-аннотации отсутствует\ndef _get_list_texture(rel_path: str) -> list:",
|
|||
|
"detail": "web_p.renderBOPdataset2",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "DIR_MODELS",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.renderBOPdataset2",
|
|||
|
"description": "web_p.renderBOPdataset2",
|
|||
|
"peekOfCode": "DIR_MODELS = \"models\"\nDIR_MESH = \"assets/libs/objects/\"\nFILE_LOG_SCENE = \"res.txt\"\nFILE_RBS_INFO = \"rbs_info.json\"\nFILE_GT_COCO = \"scene_gt_coco.json\"\nEXT_MODELS = \".fbx\"\nTEXTURE_TMPL = \"*.jpg\"\nNot_Categories_Name = True # наименование категории в COCO-аннотации отсутствует\ndef _get_list_texture(rel_path: str) -> list:\n # local_path/texture/",
|
|||
|
"detail": "web_p.renderBOPdataset2",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "DIR_MESH",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.renderBOPdataset2",
|
|||
|
"description": "web_p.renderBOPdataset2",
|
|||
|
"peekOfCode": "DIR_MESH = \"assets/libs/objects/\"\nFILE_LOG_SCENE = \"res.txt\"\nFILE_RBS_INFO = \"rbs_info.json\"\nFILE_GT_COCO = \"scene_gt_coco.json\"\nEXT_MODELS = \".fbx\"\nTEXTURE_TMPL = \"*.jpg\"\nNot_Categories_Name = True # наименование категории в COCO-аннотации отсутствует\ndef _get_list_texture(rel_path: str) -> list:\n # local_path/texture/\n loc = os.path.dirname(os.path.dirname(rnd_par.output_dir))",
|
|||
|
"detail": "web_p.renderBOPdataset2",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "FILE_LOG_SCENE",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.renderBOPdataset2",
|
|||
|
"description": "web_p.renderBOPdataset2",
|
|||
|
"peekOfCode": "FILE_LOG_SCENE = \"res.txt\"\nFILE_RBS_INFO = \"rbs_info.json\"\nFILE_GT_COCO = \"scene_gt_coco.json\"\nEXT_MODELS = \".fbx\"\nTEXTURE_TMPL = \"*.jpg\"\nNot_Categories_Name = True # наименование категории в COCO-аннотации отсутствует\ndef _get_list_texture(rel_path: str) -> list:\n # local_path/texture/\n loc = os.path.dirname(os.path.dirname(rnd_par.output_dir))\n path = os.path.join(loc, rel_path)",
|
|||
|
"detail": "web_p.renderBOPdataset2",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "FILE_RBS_INFO",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.renderBOPdataset2",
|
|||
|
"description": "web_p.renderBOPdataset2",
|
|||
|
"peekOfCode": "FILE_RBS_INFO = \"rbs_info.json\"\nFILE_GT_COCO = \"scene_gt_coco.json\"\nEXT_MODELS = \".fbx\"\nTEXTURE_TMPL = \"*.jpg\"\nNot_Categories_Name = True # наименование категории в COCO-аннотации отсутствует\ndef _get_list_texture(rel_path: str) -> list:\n # local_path/texture/\n loc = os.path.dirname(os.path.dirname(rnd_par.output_dir))\n path = os.path.join(loc, rel_path)\n return list(Path(path).absolute().rglob(TEXTURE_TMPL))",
|
|||
|
"detail": "web_p.renderBOPdataset2",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "FILE_GT_COCO",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.renderBOPdataset2",
|
|||
|
"description": "web_p.renderBOPdataset2",
|
|||
|
"peekOfCode": "FILE_GT_COCO = \"scene_gt_coco.json\"\nEXT_MODELS = \".fbx\"\nTEXTURE_TMPL = \"*.jpg\"\nNot_Categories_Name = True # наименование категории в COCO-аннотации отсутствует\ndef _get_list_texture(rel_path: str) -> list:\n # local_path/texture/\n loc = os.path.dirname(os.path.dirname(rnd_par.output_dir))\n path = os.path.join(loc, rel_path)\n return list(Path(path).absolute().rglob(TEXTURE_TMPL))\n# def _get_path_model(name_model: str) -> str:",
|
|||
|
"detail": "web_p.renderBOPdataset2",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "EXT_MODELS",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.renderBOPdataset2",
|
|||
|
"description": "web_p.renderBOPdataset2",
|
|||
|
"peekOfCode": "EXT_MODELS = \".fbx\"\nTEXTURE_TMPL = \"*.jpg\"\nNot_Categories_Name = True # наименование категории в COCO-аннотации отсутствует\ndef _get_list_texture(rel_path: str) -> list:\n # local_path/texture/\n loc = os.path.dirname(os.path.dirname(rnd_par.output_dir))\n path = os.path.join(loc, rel_path)\n return list(Path(path).absolute().rglob(TEXTURE_TMPL))\n# def _get_path_model(name_model: str) -> str:\n# # TODO on name_model find path for mesh (model.fbx)",
|
|||
|
"detail": "web_p.renderBOPdataset2",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "TEXTURE_TMPL",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.renderBOPdataset2",
|
|||
|
"description": "web_p.renderBOPdataset2",
|
|||
|
"peekOfCode": "TEXTURE_TMPL = \"*.jpg\"\nNot_Categories_Name = True # наименование категории в COCO-аннотации отсутствует\ndef _get_list_texture(rel_path: str) -> list:\n # local_path/texture/\n loc = os.path.dirname(os.path.dirname(rnd_par.output_dir))\n path = os.path.join(loc, rel_path)\n return list(Path(path).absolute().rglob(TEXTURE_TMPL))\n# def _get_path_model(name_model: str) -> str:\n# # TODO on name_model find path for mesh (model.fbx)\n# # local_path/assets/libs/objects # assets/mesh/",
|
|||
|
"detail": "web_p.renderBOPdataset2",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "Not_Categories_Name",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.renderBOPdataset2",
|
|||
|
"description": "web_p.renderBOPdataset2",
|
|||
|
"peekOfCode": "Not_Categories_Name = True # наименование категории в COCO-аннотации отсутствует\ndef _get_list_texture(rel_path: str) -> list:\n # local_path/texture/\n loc = os.path.dirname(os.path.dirname(rnd_par.output_dir))\n path = os.path.join(loc, rel_path)\n return list(Path(path).absolute().rglob(TEXTURE_TMPL))\n# def _get_path_model(name_model: str) -> str:\n# # TODO on name_model find path for mesh (model.fbx)\n# # local_path/assets/libs/objects # assets/mesh/\n# loc = os.path.dirname(os.path.dirname(rnd_par.output_dir))",
|
|||
|
"detail": "web_p.renderBOPdataset2",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "copy_and_move_folder",
|
|||
|
"kind": 2,
|
|||
|
"importPath": "web_p.robot_builder",
|
|||
|
"description": "web_p.robot_builder",
|
|||
|
"peekOfCode": "def copy_and_move_folder(src, dst):\n try:\n if os.path.exists(dst):\n shutil.rmtree(dst)\n shutil.copytree(src, dst)\n print(f\"Folder {src} successfully copied\")\n except shutil.Error as e:\n print(f\"Error: {e}\")\nsource_folder = os.path.dirname(os.path.abspath(__file__)) + \"/robot_builder/\"\ncopy_and_move_folder(source_folder, args.path + args.name)",
|
|||
|
"detail": "web_p.robot_builder",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "parser",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.robot_builder",
|
|||
|
"description": "web_p.robot_builder",
|
|||
|
"peekOfCode": "parser = argparse.ArgumentParser()\nparser.add_argument(\"--path\")\nparser.add_argument(\"--nDOF\")\nparser.add_argument(\"--toolType\")\nparser.add_argument(\"--name\")\nargs = parser.parse_args()\ndef copy_and_move_folder(src, dst):\n try:\n if os.path.exists(dst):\n shutil.rmtree(dst)",
|
|||
|
"detail": "web_p.robot_builder",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "args",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.robot_builder",
|
|||
|
"description": "web_p.robot_builder",
|
|||
|
"peekOfCode": "args = parser.parse_args()\ndef copy_and_move_folder(src, dst):\n try:\n if os.path.exists(dst):\n shutil.rmtree(dst)\n shutil.copytree(src, dst)\n print(f\"Folder {src} successfully copied\")\n except shutil.Error as e:\n print(f\"Error: {e}\")\nsource_folder = os.path.dirname(os.path.abspath(__file__)) + \"/robot_builder/\"",
|
|||
|
"detail": "web_p.robot_builder",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "source_folder",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.robot_builder",
|
|||
|
"description": "web_p.robot_builder",
|
|||
|
"peekOfCode": "source_folder = os.path.dirname(os.path.abspath(__file__)) + \"/robot_builder/\"\ncopy_and_move_folder(source_folder, args.path + args.name)",
|
|||
|
"detail": "web_p.robot_builder",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "trans_3Dto2D_point_in_camera",
|
|||
|
"kind": 2,
|
|||
|
"importPath": "web_p.train_Dope",
|
|||
|
"description": "web_p.train_Dope",
|
|||
|
"peekOfCode": "def trans_3Dto2D_point_in_camera(xyz, K_m, R_m2c, t_m2c):\n \"\"\"\n xyz : 3D-координаты точки\n K_m : внутренняя матрица камеры 3х3\n R_m2c : матрица поворота 3х3\n t_m2c : вектор перемещения 3х1\n return [u,v]\n \"\"\"\n K = np.array(K_m)\n r = np.array(R_m2c)",
|
|||
|
"detail": "web_p.train_Dope",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "gt_parse",
|
|||
|
"kind": 2,
|
|||
|
"importPath": "web_p.train_Dope",
|
|||
|
"description": "web_p.train_Dope",
|
|||
|
"peekOfCode": "def gt_parse(path: str, out_dir: str):\n global nn_image\n with open(os.path.join(path, FILE_GT_COCO), \"r\") as fh:\n coco_data = json.load(fh)\n with open(os.path.join(path, FILE_GT), \"r\") as fh:\n gt_data = json.load(fh)\n with open(os.path.join(path, FILE_GT_INFO), \"r\") as fh:\n gt_info = json.load(fh)\n for img in coco_data[\"images\"]:\n rgb_file = os.path.join(path, img[\"file_name\"])",
|
|||
|
"detail": "web_p.train_Dope",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "explore",
|
|||
|
"kind": 2,
|
|||
|
"importPath": "web_p.train_Dope",
|
|||
|
"description": "web_p.train_Dope",
|
|||
|
"peekOfCode": "def explore(path: str, res_dir: str):\n if not os.path.isdir(path):\n return\n folders = [\n os.path.join(path, o)\n for o in os.listdir(path)\n if os.path.isdir(os.path.join(path, o))\n ]\n for path_entry in folders:\n if os.path.isfile(os.path.join(path_entry,FILE_GT_COCO)) and \\",
|
|||
|
"detail": "web_p.train_Dope",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "BOP2DOPE_dataset",
|
|||
|
"kind": 2,
|
|||
|
"importPath": "web_p.train_Dope",
|
|||
|
"description": "web_p.train_Dope",
|
|||
|
"peekOfCode": "def BOP2DOPE_dataset(dpath: str, out_dir: str) -> str:\n \"\"\" Convert BOP-dataset to YOLO format for train \"\"\"\n res_dir = os.path.join(out_dir, DIR_ROOT_DS)\n if os.path.isdir(res_dir):\n shutil.rmtree(res_dir)\n os.mkdir(res_dir)\n explore(dpath, res_dir)\n return out_dir\ndef train(dopepath:str, wname:str, epochs:int, pretrain: bool, lname: list):\n import random",
|
|||
|
"detail": "web_p.train_Dope",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "train",
|
|||
|
"kind": 2,
|
|||
|
"importPath": "web_p.train_Dope",
|
|||
|
"description": "web_p.train_Dope",
|
|||
|
"peekOfCode": "def train(dopepath:str, wname:str, epochs:int, pretrain: bool, lname: list):\n import random\n # try:\n import configparser as configparser\n # except ImportError:\n # import ConfigParser as configparser\n import torch\n # import torch.nn.parallel\n import torch.optim as optim\n import torch.utils.data",
|
|||
|
"detail": "web_p.train_Dope",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "train_Dope_i",
|
|||
|
"kind": 2,
|
|||
|
"importPath": "web_p.train_Dope",
|
|||
|
"description": "web_p.train_Dope",
|
|||
|
"peekOfCode": "def train_Dope_i(path:str, wname:str, dname:str, outpath:str, epochs:int, pretrain: bool):\n \"\"\" Main procedure for train DOPE model \"\"\"\n global K_intrinsic, model_info, camera_data, im_width\n if not os.path.isdir(outpath):\n print(f\"Invalid output path '{outpath}'\")\n exit(-1)\n out_dir = os.path.join(outpath, wname)\n ds_path = os.path.join(path, dname)\n if not os.path.isdir(ds_path):\n print(f\"{ds_path} : no BOP directory\")",
|
|||
|
"detail": "web_p.train_Dope",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "FILE_RBS_INFO",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.train_Dope",
|
|||
|
"description": "web_p.train_Dope",
|
|||
|
"peekOfCode": "FILE_RBS_INFO = \"rbs_info.json\"\nFILE_CAMERA = \"camera.json\"\nFILE_GT = \"scene_gt.json\"\nFILE_GT_COCO = \"scene_gt_coco.json\"\nFILE_GT_INFO = \"scene_gt_info.json\"\nFILE_MODEL = \"epoch\"\nEXT_MODEL = \".pth\"\nEXT_RGB = \"jpg\"\nDIR_ROOT_DS = \"dataset_dope\"\nDIR_TRAIN_OUT = \"out_weights\"",
|
|||
|
"detail": "web_p.train_Dope",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "MODEL_SCALE",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.train_Dope",
|
|||
|
"description": "web_p.train_Dope",
|
|||
|
"peekOfCode": "MODEL_SCALE = 1000 # исходная модель в метрах, преобразуем в мм (для DOPE)\n# Own_Numbering_Files = True # наименование image-файлов: собственная нумерация\nnn_image = 0\nK_intrinsic = []\nmodel_info = []\ncamera_data = {}\nim_width = 0\nnb_update_network = 0\n# [\n# [min(x), min(y), min(z)],",
|
|||
|
"detail": "web_p.train_Dope",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "nn_image",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.train_Dope",
|
|||
|
"description": "web_p.train_Dope",
|
|||
|
"peekOfCode": "nn_image = 0\nK_intrinsic = []\nmodel_info = []\ncamera_data = {}\nim_width = 0\nnb_update_network = 0\n# [\n# [min(x), min(y), min(z)],\n# [min(x), max(y), min(z)],\n# [min(x), max(y), max(z)],",
|
|||
|
"detail": "web_p.train_Dope",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "K_intrinsic",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.train_Dope",
|
|||
|
"description": "web_p.train_Dope",
|
|||
|
"peekOfCode": "K_intrinsic = []\nmodel_info = []\ncamera_data = {}\nim_width = 0\nnb_update_network = 0\n# [\n# [min(x), min(y), min(z)],\n# [min(x), max(y), min(z)],\n# [min(x), max(y), max(z)],\n# [min(x), min(y), max(z)],",
|
|||
|
"detail": "web_p.train_Dope",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "model_info",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.train_Dope",
|
|||
|
"description": "web_p.train_Dope",
|
|||
|
"peekOfCode": "model_info = []\ncamera_data = {}\nim_width = 0\nnb_update_network = 0\n# [\n# [min(x), min(y), min(z)],\n# [min(x), max(y), min(z)],\n# [min(x), max(y), max(z)],\n# [min(x), min(y), max(z)],\n# [max(x), min(y), max(z)],",
|
|||
|
"detail": "web_p.train_Dope",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "camera_data",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.train_Dope",
|
|||
|
"description": "web_p.train_Dope",
|
|||
|
"peekOfCode": "camera_data = {}\nim_width = 0\nnb_update_network = 0\n# [\n# [min(x), min(y), min(z)],\n# [min(x), max(y), min(z)],\n# [min(x), max(y), max(z)],\n# [min(x), min(y), max(z)],\n# [max(x), min(y), max(z)],\n# [max(x), max(y), min(z)],",
|
|||
|
"detail": "web_p.train_Dope",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "im_width",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.train_Dope",
|
|||
|
"description": "web_p.train_Dope",
|
|||
|
"peekOfCode": "im_width = 0\nnb_update_network = 0\n# [\n# [min(x), min(y), min(z)],\n# [min(x), max(y), min(z)],\n# [min(x), max(y), max(z)],\n# [min(x), min(y), max(z)],\n# [max(x), min(y), max(z)],\n# [max(x), max(y), min(z)],\n# [max(x), max(y), max(z)],",
|
|||
|
"detail": "web_p.train_Dope",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "nb_update_network",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.train_Dope",
|
|||
|
"description": "web_p.train_Dope",
|
|||
|
"peekOfCode": "nb_update_network = 0\n# [\n# [min(x), min(y), min(z)],\n# [min(x), max(y), min(z)],\n# [min(x), max(y), max(z)],\n# [min(x), min(y), max(z)],\n# [max(x), min(y), max(z)],\n# [max(x), max(y), min(z)],\n# [max(x), max(y), max(z)],\n# [max(x), min(y), max(z)],",
|
|||
|
"detail": "web_p.train_Dope",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "convert2relative",
|
|||
|
"kind": 2,
|
|||
|
"importPath": "web_p.train_Yolo",
|
|||
|
"description": "web_p.train_Yolo",
|
|||
|
"peekOfCode": "def convert2relative(height, width, bbox):\n \"\"\" YOLO format use relative coordinates for annotation \"\"\"\n x, y, w, h = bbox\n x += w/2\n y += h/2\n return x/width, y/height, w/width, h/height\ndef gt_parse(path: str, out_dir: str):\n global nn_image, f1, f2\n with open(os.path.join(path, FILE_GT_COCO), \"r\") as fh:\n coco_data = json.load(fh)",
|
|||
|
"detail": "web_p.train_Yolo",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "gt_parse",
|
|||
|
"kind": 2,
|
|||
|
"importPath": "web_p.train_Yolo",
|
|||
|
"description": "web_p.train_Yolo",
|
|||
|
"peekOfCode": "def gt_parse(path: str, out_dir: str):\n global nn_image, f1, f2\n with open(os.path.join(path, FILE_GT_COCO), \"r\") as fh:\n coco_data = json.load(fh)\n for img in coco_data[\"images\"]:\n rgb_file = os.path.join(path, img[\"file_name\"])\n if os.path.isfile(rgb_file):\n ext = os.path.splitext(rgb_file)[1] # only ext\n f = f\"{nn_image:06}\"\n out_img = os.path.join(out_dir, DIR_RGB_DS, f + ext)",
|
|||
|
"detail": "web_p.train_Yolo",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "explore",
|
|||
|
"kind": 2,
|
|||
|
"importPath": "web_p.train_Yolo",
|
|||
|
"description": "web_p.train_Yolo",
|
|||
|
"peekOfCode": "def explore(path: str, res_dir: str):\n if not os.path.isdir(path):\n return\n folders = [\n os.path.join(path, o)\n for o in os.listdir(path)\n if os.path.isdir(os.path.join(path, o))\n ]\n for path_entry in folders:\n if os.path.isfile(os.path.join(path_entry,FILE_GT_COCO)):",
|
|||
|
"detail": "web_p.train_Yolo",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "BOP2Yolo_dataset",
|
|||
|
"kind": 2,
|
|||
|
"importPath": "web_p.train_Yolo",
|
|||
|
"description": "web_p.train_Yolo",
|
|||
|
"peekOfCode": "def BOP2Yolo_dataset(dpath: str, out_dir: str, lname: list) -> str:\n \"\"\" Convert BOP-dataset to YOLO format for train \"\"\"\n cfg_yaml = os.path.join(out_dir, FILE_RBS_TRAIN)\n p = os.path.join(out_dir, DIR_ROOT_DS, DIR_COCO_DS)\n cfg_data = {\"path\": p, \"train\": FILE_L_TRAIN, \"val\": FILE_L_VAL}\n cfg_data[\"names\"] = {i:x for i,x in enumerate(lname)}\n with open(cfg_yaml, \"w\") as fh:\n yaml.dump(cfg_data, fh)\n res_dir = os.path.join(out_dir, DIR_ROOT_DS)\n if not os.path.isdir(res_dir):",
|
|||
|
"detail": "web_p.train_Yolo",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "train_YoloV8",
|
|||
|
"kind": 2,
|
|||
|
"importPath": "web_p.train_Yolo",
|
|||
|
"description": "web_p.train_Yolo",
|
|||
|
"peekOfCode": "def train_YoloV8(path:str, wname:str, dname:str, outpath:str, epochs:int, pretrain: bool):\n \"\"\" Main procedure for train YOLOv8 model \"\"\"\n if not os.path.isdir(outpath):\n print(f\"Invalid output path '{outpath}'\")\n exit(-1)\n out_dir = os.path.join(outpath, wname)\n if pretrain:\n # продолжить обучение\n if not os.path.isdir(out_dir):\n print(f\"No dir '{out_dir}'\")",
|
|||
|
"detail": "web_p.train_Yolo",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "FILE_BASEMODEL",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.train_Yolo",
|
|||
|
"description": "web_p.train_Yolo",
|
|||
|
"peekOfCode": "FILE_BASEMODEL = \"yolov8n.pt\"\nFILE_RBS_INFO = \"rbs_info.json\"\nFILE_RBS_TRAIN = \"rbs_train.yaml\"\nFILE_GT_COCO = \"scene_gt_coco.json\"\nFILE_L_TRAIN = \"i_train.txt\"\nFILE_L_VAL = \"i_val.txt\"\nFILE_TRAIN_RES = \"weights/last.pt\"\nDIR_ROOT_DS = \"datasets\"\nDIR_COCO_DS = \"rbs_coco\"\nDIR_RGB_DS = \"images\"",
|
|||
|
"detail": "web_p.train_Yolo",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "FILE_RBS_TRAIN",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.train_Yolo",
|
|||
|
"description": "web_p.train_Yolo",
|
|||
|
"peekOfCode": "FILE_RBS_TRAIN = \"rbs_train.yaml\"\nFILE_GT_COCO = \"scene_gt_coco.json\"\nFILE_L_TRAIN = \"i_train.txt\"\nFILE_L_VAL = \"i_val.txt\"\nFILE_TRAIN_RES = \"weights/last.pt\"\nDIR_ROOT_DS = \"datasets\"\nDIR_COCO_DS = \"rbs_coco\"\nDIR_RGB_DS = \"images\"\nDIR_LABELS_DS = \"labels\"\nSZ_SERIES = 15 # number of train images per validation images",
|
|||
|
"detail": "web_p.train_Yolo",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "FILE_TRAIN_RES",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.train_Yolo",
|
|||
|
"description": "web_p.train_Yolo",
|
|||
|
"peekOfCode": "FILE_TRAIN_RES = \"weights/last.pt\"\nDIR_ROOT_DS = \"datasets\"\nDIR_COCO_DS = \"rbs_coco\"\nDIR_RGB_DS = \"images\"\nDIR_LABELS_DS = \"labels\"\nSZ_SERIES = 15 # number of train images per validation images\nnn_image = 0\nf1 = f2 = None\ndef convert2relative(height, width, bbox):\n \"\"\" YOLO format use relative coordinates for annotation \"\"\"",
|
|||
|
"detail": "web_p.train_Yolo",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "SZ_SERIES",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.train_Yolo",
|
|||
|
"description": "web_p.train_Yolo",
|
|||
|
"peekOfCode": "SZ_SERIES = 15 # number of train images per validation images\nnn_image = 0\nf1 = f2 = None\ndef convert2relative(height, width, bbox):\n \"\"\" YOLO format use relative coordinates for annotation \"\"\"\n x, y, w, h = bbox\n x += w/2\n y += h/2\n return x/width, y/height, w/width, h/height\ndef gt_parse(path: str, out_dir: str):",
|
|||
|
"detail": "web_p.train_Yolo",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "nn_image",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.train_Yolo",
|
|||
|
"description": "web_p.train_Yolo",
|
|||
|
"peekOfCode": "nn_image = 0\nf1 = f2 = None\ndef convert2relative(height, width, bbox):\n \"\"\" YOLO format use relative coordinates for annotation \"\"\"\n x, y, w, h = bbox\n x += w/2\n y += h/2\n return x/width, y/height, w/width, h/height\ndef gt_parse(path: str, out_dir: str):\n global nn_image, f1, f2",
|
|||
|
"detail": "web_p.train_Yolo",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "f1",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.train_Yolo",
|
|||
|
"description": "web_p.train_Yolo",
|
|||
|
"peekOfCode": "f1 = f2 = None\ndef convert2relative(height, width, bbox):\n \"\"\" YOLO format use relative coordinates for annotation \"\"\"\n x, y, w, h = bbox\n x += w/2\n y += h/2\n return x/width, y/height, w/width, h/height\ndef gt_parse(path: str, out_dir: str):\n global nn_image, f1, f2\n with open(os.path.join(path, FILE_GT_COCO), \"r\") as fh:",
|
|||
|
"detail": "web_p.train_Yolo",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "copy_and_move_folder",
|
|||
|
"kind": 2,
|
|||
|
"importPath": "web_p.train_mock",
|
|||
|
"description": "web_p.train_mock",
|
|||
|
"peekOfCode": "def copy_and_move_folder(src, dst):\n try:\n if os.path.exists(dst):\n shutil.rmtree(dst)\n shutil.copytree(src, dst)\n print(f\"Folder {src} successfully copied\")\n except shutil.Error as e:\n print(f\"Error: {e}\")\nsource_folder = os.path.dirname(os.path.abspath(__file__)) + \"/train/\"\ncopy_and_move_folder(source_folder, args.path)",
|
|||
|
"detail": "web_p.train_mock",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "parser",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.train_mock",
|
|||
|
"description": "web_p.train_mock",
|
|||
|
"peekOfCode": "parser = argparse.ArgumentParser()\nparser.add_argument(\"--path\")\nparser.add_argument(\"--form\")\nargs = parser.parse_args()\ndef copy_and_move_folder(src, dst):\n try:\n if os.path.exists(dst):\n shutil.rmtree(dst)\n shutil.copytree(src, dst)\n print(f\"Folder {src} successfully copied\")",
|
|||
|
"detail": "web_p.train_mock",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "args",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.train_mock",
|
|||
|
"description": "web_p.train_mock",
|
|||
|
"peekOfCode": "args = parser.parse_args()\ndef copy_and_move_folder(src, dst):\n try:\n if os.path.exists(dst):\n shutil.rmtree(dst)\n shutil.copytree(src, dst)\n print(f\"Folder {src} successfully copied\")\n except shutil.Error as e:\n print(f\"Error: {e}\")\nsource_folder = os.path.dirname(os.path.abspath(__file__)) + \"/train/\"",
|
|||
|
"detail": "web_p.train_mock",
|
|||
|
"documentation": {}
|
|||
|
},
|
|||
|
{
|
|||
|
"label": "source_folder",
|
|||
|
"kind": 5,
|
|||
|
"importPath": "web_p.train_mock",
|
|||
|
"description": "web_p.train_mock",
|
|||
|
"peekOfCode": "source_folder = os.path.dirname(os.path.abspath(__file__)) + \"/train/\"\ncopy_and_move_folder(source_folder, args.path)",
|
|||
|
"detail": "web_p.train_mock",
|
|||
|
"documentation": {}
|
|||
|
}
|
|||
|
]
|