Merging two classes in cityscape dataset - image-segmentation

How can I merge two classes from the cityscape dataset, for instance the class car and truck, into a new class? Also, I need to specify the percentage of data to be merged from each of the class. For instance, 50% from class car and 50% from class truck is to merged and a new class has to be created.

Related

Can two classes be assigned to one enumerator in UML Class diagram

I am making an UML Class diagram, and got a question on which i could not find an answer.
So the situation is-
I have a class for employee and a class for the client. Both need their name added. Can I use one enumerator called "Name" for both classes, or I need to make an separate enumerator for each class with different naming?
For example-
One enumerator for both classes-
Or two enumerators- one for each class

How to decide whether a method should belong to which class?

I have 3 classes:
product
product_list
and customer
The product_list class has an array list, which stores product objects.
If I have a viewProduct method, it should belong to customer class or product_list class?
With my own concept, a viewProduct method should belong to customer class, because customer views products. But in code-wise, how a method in customer class gets data from product_list class?
A class is a data structure, bound together with the algorithms working on it.
Thus, if you decide where to put a method, the rule of thumb is this: select the class, on whose data structures it works the most. If you do it well, it should not even access the data members of other classes directly, only their methods.
Also from the name of the method is it visible, that you are right, that viewProduct should belong to customer: if it would belong to a product, then the viewProduct name would be redundant. Then a view name would be better.
You example does not say anything, how customers relate to specific products. For example, if you would develop a webshop, then the customers would likely choose a product from a list which your controllers generated for them.
Your specification lacks the mechanism, how customers relate to products. Think on it, and you will know the answer.

What is the use of creating type properties in Swift?

What is the use of type method in swift can anyone give the realtime usage example? because I see it has not been used in any instance of the class
class SomeClass {
static var name=0
SomeClass.someTypeMethod()
}
Let's use the analogy of a car factory. We'll create a Car class. You can think of the Car class as the factory that builds Cars. You use an initializer to build new cars.
The class itself does work that affects all cars: sets prices, orders supplies, schedules payments, etc. An individual car provides transportation.
Say cars have FM radios, and they come with a default set of station presets. You might have a type method that changes the set of default stations that are programmed into a new car. Once you've changed the default stations, new cars built by the factory would have different default stations.

class create another class and associate with it later delete it, how to show it in UML class diagram?

Let A and B are classes.
A is the class which is responsible for creating class B
after creating of ,B A is associated with B
after some time class A is Delete class B
as a example for above scenario consider
there is project manager and he is responsible for creating,editing,deleting project from the system
i know class A create class b can show in UML as dependency relationship
i have two questions
how to represent class delete another class
so there is both association and dependency relationship from A to B.
How should this relationship be demonstrated on UML class diagram? Should I use booth association(straight line) and dependency(dashed line) relationships
You simply put a multiplicity of 0..1 towards the association to B. And that's it. No extra dependency.

MVVM viewmodel and model questions

I'm trying to learn MVVM, and i'm struggling a little on differentiating between a model and viewmodel.
If someone could answer these 2 questions it would help clear a lot up for me:
Say I have an Objects class, which is a viewmodel that contains multiple ObservableCollections of Object.
The Object class contains an ObservableCollection of strings that are displayed on the GUI.
Is the Object class a model or viewmodel?
What if the Object class contains just a string and a integer (name and value), is it a model or viewmodel?
The Model is the class that holds your data. The data can be strings /integers or whatever.
The Model can also be a list / collection of those objects. For example a List of Person objects can still be your Model.
The ViewModel is the tier between your Model and the View. It should be used to perform whatever tasks you need on the data (for instance, if your Model is a list of Person objects but you only want to show in your view people that are aged older then 18, this logic is done in the ViewModel)
So to answer your question:
If you have an object which contains the data (in your example a list of strings) it is the Model.
Even if the object is a little more complex (with relation to the number of properties it holds) it's probably still the Model.
Business Logic should be kept separate from the model. On the other hand Validation can be added to the Model (for instance to make sure the Age property of a person is non-negative) since this is still rules on how your data should behave