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 os | |
import turicreate as tc | |
import xml.etree.cElementTree as XMLParser | |
# Takes the XML for a bounding box and returns a Dictionary containing the center X and Y coordinates of the box, | |
# along with its width and height. | |
def get_bounding_box(xml): | |
box = xml.find('bndbox') | |
x_min, x_max = float(box.find('xmin').text), float(box.find('xmax').text) |
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 os | |
import turicreate as tc | |
path = '../' # The path to the root of your project directory. | |
sf_path = os.path.join(path, 'data.sframe') # The path to load the SFrame from. See `gen_sframe.py` for more. | |
data = tc.SFrame(sf_path) # The training data for our model. | |
# This takes the first 50 rows from the SFrame we just loaded from disk and drops the rest of it. We do this so the | |
# visualization doesn't take too long to load and run. | |
data = data.head(50) |
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 os | |
import turicreate as tc | |
path = '../' # The path to the root of your project directory. | |
coreml_path = os.path.join(path, 'pascal.mlmodel') # The path to export the Core ML model to. | |
model_path = os.path.join(path, 'pascal.model') # The path to export the .model file to. | |
sf_path = os.path.join(path, 'data.sframe') # The path to load the SFrame from. See gen_sframe.py for more. | |
result_sf_path = os.path.join(path, 'result_data.sframe') # The path to save the test data with predictions to. | |
data = tc.SFrame(sf_path) # The training data for our model. |
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 os | |
import turicreate as tc | |
path = '../' # The path to the root of your project directory. | |
model_path = os.path.join(path, 'pascal.model') # The path to the trained model. See train_model.py for more. | |
result_sf_path = os.path.join(path, 'result_data.sframe') # The path to the result data from training the model. | |
# Loads the result data from training the model, along with the model itself. | |
data = tc.SFrame(result_sf_path) | |
model = tc.load_model(model_path) |
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
pranjal:app $ flutter run --verbose | |
[ +35 ms] executing: [/Users/pranjal/flutter/] git log -n 1 --pretty=format:%H | |
[ +41 ms] Exit code 0 from: git log -n 1 --pretty=format:%H | |
[ ] 7a4c33425ddd78c54aba07d86f3f9a4a0051769b | |
[ ] executing: [/Users/pranjal/flutter/] git describe --match v*.*.* --first-parent --long --tags | |
[ +18 ms] Exit code 0 from: git describe --match v*.*.* --first-parent --long --tags | |
[ ] v1.5.4-hotfix.2-0-g7a4c33425 | |
[ +14 ms] executing: [/Users/pranjal/flutter/] git rev-parse --abbrev-ref --symbolic @{u} | |
[ +11 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u} | |
[ ] origin/stable |
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
List(data, id: \.self) { | |
Text($0) | |
} |
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
class UITableViewCoordinator: UITableViewDataSource, UITableViewDelegate { | |
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | |
data.count | |
} | |
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | |
let cell = tableView.dequeueReusableCell(withIdentifier: "identifier") as! Cell | |
// configure it | |
return cell | |
} |
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
let dataSource = DataSource() | |
dataSource.sections = [ | |
Section(rows: [ | |
Row(text: "Hello") | |
]) | |
] | |
dataSource.tableView = tableView |
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
tableView.descriptor = UITableViewDescriptor(sections: [ | |
UITableViewSection( | |
items: $data, | |
cellProvider: {(tableView, indexPath, element) in | |
let cell = Cell.dequeue(in: tableView) | |
cell.configure(with: element) | |
return cell | |
} | |
) |
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
class UITableViewSection: NSObject { | |
private(set) var items = [AnyHashable]() | |
private(set) var sectionIndex: Int! | |
private let itemsPublisher: AnyPublisher<[AnyHashable], Never> | |
private let cellProvider: (UITableView, IndexPath, AnyHashable) -> UITableViewCell | |
private var subscriptions = Set<AnyCancellable>() | |
convenience init<T: Hashable>( |
OlderNewer